diff python/testasm.py @ 196:ec2b423cdbea

Merge asm and asmlib files
author Windel Bouwman
date Sat, 01 Jun 2013 11:55:49 +0200
parents 37ac6c016e0f
children 33d50727a23c
line wrap: on
line diff
--- a/python/testasm.py	Fri May 31 21:06:44 2013 +0200
+++ b/python/testasm.py	Sat Jun 01 11:55:49 2013 +0200
@@ -77,10 +77,23 @@
         output = []
         output.append(ALabel('lab1'))
         self.assertSequenceEqual(output, a.output)
+
+    def testParse6(self):
+        # A line can be empty
+        a = libasm.Assembler()
+        a.parse_line('')
     
     def testX86(self):
-        # TODO
-        pass
+        testsrc = """
+        begin:
+        mov rax, rbx
+        xor rcx, rbx
+        inc rcx
+        """
+        a = libasm.Assembler()
+        a.assemble(testsrc)
+        # Compare with nasm output:
+        nasmbytes = [0x48, 0x89, 0xd8, 0x48, 0x31, 0xd9, 0x48, 0xff, 0xc1]
 
 if __name__ == '__main__':
     unittest.main()