mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-10 14:26:45 +00:00
SETA test to confirm I can close #184
This commit is contained in:
parent
421a983910
commit
51c0d4c3c7
@ -1,11 +1,14 @@
|
||||
package net.simon987.mar.server.assembly.instruction;
|
||||
|
||||
import net.simon987.mar.server.TestExecutionResult;
|
||||
import net.simon987.mar.server.assembly.Register;
|
||||
import net.simon987.mar.server.assembly.RegisterSet;
|
||||
import net.simon987.mar.server.assembly.Status;
|
||||
import net.simon987.mar.server.assembly.TestHelper;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
|
||||
public class SetaInstructionTest {
|
||||
@ -25,6 +28,21 @@ public class SetaInstructionTest {
|
||||
instruction = new SetaInstruction();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void setaSimple1() {
|
||||
String code = "" +
|
||||
"MOV A, 3 \n" +
|
||||
"MOV B, 3 \n" +
|
||||
"CMP A, B \n" +
|
||||
"SETE X \n" +
|
||||
"brk \n";
|
||||
|
||||
TestExecutionResult res = TestHelper.executeCode(code);
|
||||
|
||||
assertTrue(res.ar.exceptions.isEmpty());
|
||||
assertEquals(1, res.regValue("X"));
|
||||
}
|
||||
|
||||
/**
|
||||
* SETA, SETNBE Above, Not Below or Equal CF=0 AND ZF=0
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user