comparison 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
comparison
equal deleted inserted replaced
195:37ac6c016e0f 196:ec2b423cdbea
75 a = libasm.Assembler() 75 a = libasm.Assembler()
76 a.parse_line(asmline) 76 a.parse_line(asmline)
77 output = [] 77 output = []
78 output.append(ALabel('lab1')) 78 output.append(ALabel('lab1'))
79 self.assertSequenceEqual(output, a.output) 79 self.assertSequenceEqual(output, a.output)
80
81 def testParse6(self):
82 # A line can be empty
83 a = libasm.Assembler()
84 a.parse_line('')
80 85
81 def testX86(self): 86 def testX86(self):
82 # TODO 87 testsrc = """
83 pass 88 begin:
89 mov rax, rbx
90 xor rcx, rbx
91 inc rcx
92 """
93 a = libasm.Assembler()
94 a.assemble(testsrc)
95 # Compare with nasm output:
96 nasmbytes = [0x48, 0x89, 0xd8, 0x48, 0x31, 0xd9, 0x48, 0xff, 0xc1]
84 97
85 if __name__ == '__main__': 98 if __name__ == '__main__':
86 unittest.main() 99 unittest.main()
87 100