aboutsummaryrefslogtreecommitdiffstats
path: root/asm
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2023-02-07 17:30:29 +0000
committerGravatar Peter McGoron 2023-02-07 17:30:29 +0000
commit972a8ac8f107d8529ed2cccf62e672ef965bb5ed (patch)
tree89ebf597f969ea458d843127733049403322278f /asm
parentassembler: refactor and start tests (diff)
more asm test
Diffstat (limited to '')
-rw-r--r--asm_test.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/asm_test.py b/asm_test.py
index 481875b..016f634 100644
--- a/asm_test.py
+++ b/asm_test.py
@@ -12,6 +12,12 @@ class ProgramTest(unittest.TestCase):
p.parse_asm_line("PUSH r134217727")
b = p()
self.assertEqual(b, b'\x01\xFC\x87\xbf\xbf\xbf\xbf\x00')
+ def test_two(self):
+ p = Program()
+ p.parse_asm_line("PUSH r1")
+ p.parse_asm_line("ADD r1 5 6")
+ b = p()
+ self.assertEqual(b, b'\x01\xC2\x81\x00\x03\xC2\x81\xC0\x85\xC0\x86\x00')
if __name__ == "__main__":
unittest.main()