diff python/testasm.py @ 218:494828a7adf1

added some sort of cache to assembler
author Windel Bouwman
date Fri, 05 Jul 2013 15:30:22 +0200
parents 62386bcee1ba
children 1fa3e0050b49
line wrap: on
line diff
--- a/python/testasm.py	Fri Jul 05 14:13:59 2013 +0200
+++ b/python/testasm.py	Fri Jul 05 15:30:22 2013 +0200
@@ -5,7 +5,7 @@
 from asmnodes import AInstruction, ABinop, AUnop, ASymbol, ALabel, ANumber
 from asm import tokenize, Assembler
 import msp430
-import arm_cm3
+import cortexm3 as arm
 
 class AssemblerLexingCase(unittest.TestCase):
     """ Tests the assemblers lexer """
@@ -150,14 +150,14 @@
 
 class AssemblerARMTestCase(unittest.TestCase):
     def setUp(self):
-        self.t = arm_cm3.armtarget
+        self.t = arm.armtarget
         self.a = Assembler(target=self.t)
 
     def feed(self, line):
         self.a.assemble(line)
 
     def check(self, hexstr):
-        self.assertEqual(bytes.fromhex(hexstr), self.a.binout)
+        self.assertSequenceEqual(bytes.fromhex(hexstr), self.a.binout)
         
     def testMapOperand(self):
         pass
@@ -186,6 +186,10 @@
         self.feed('ldr r4, [r0 + 0]')
         self.check('0468')
 
+    def testCmpRegReg(self):
+        self.feed('cmp r0, r1')
+        self.check('8842')
+
     def testSequence1(self):
         self.feed('mov r5, 3')
         self.feed('add r4, r5, 0')