mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-18 02:06:43 +00:00
Test for DW directive with strings (#228)
This commit is contained in:
parent
319abad130
commit
fe299fe061
@ -0,0 +1,23 @@
|
|||||||
|
package net.simon987.mar.server.assembly;
|
||||||
|
|
||||||
|
import net.simon987.mar.server.TestExecutionResult;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
|
public class DwDirectiveTest {
|
||||||
|
@Test
|
||||||
|
public void dwStringWikiExample() {
|
||||||
|
String code = "" +
|
||||||
|
"my_str: DW \"Hello\" \n" +
|
||||||
|
".text \n" +
|
||||||
|
"MOV A, [my_str] \n" +
|
||||||
|
"brk \n";
|
||||||
|
|
||||||
|
TestExecutionResult res = TestHelper.executeCode(code);
|
||||||
|
|
||||||
|
assertTrue(res.ar.exceptions.isEmpty());
|
||||||
|
assertEquals('H', res.regValue("A"));
|
||||||
|
}
|
||||||
|
}
|
@ -14,7 +14,7 @@ public class OrgDirectiveTest {
|
|||||||
"ORG 0x8000 \n" +
|
"ORG 0x8000 \n" +
|
||||||
"my_var: DW 0x1234 \n" +
|
"my_var: DW 0x1234 \n" +
|
||||||
".text \n" +
|
".text \n" +
|
||||||
"MOV A, my_var \n" +
|
"MOV A, my_var \n" +
|
||||||
"brk \n";
|
"brk \n";
|
||||||
|
|
||||||
TestExecutionResult res = TestHelper.executeCode(code);
|
TestExecutionResult res = TestHelper.executeCode(code);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user