mirror of
https://github.com/simon987/Much-Assembly-Required.git
synced 2025-04-19 18:46: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"));
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user