diff python/cortexm3.py @ 258:04c19282a5aa

Added register allocator
author Windel Bouwman
date Mon, 05 Aug 2013 19:46:11 +0200
parents 6ed3d3a82a63
children 444b9df2ed99
line wrap: on
line diff
--- a/python/cortexm3.py	Sun Aug 04 18:34:06 2013 +0200
+++ b/python/cortexm3.py	Mon Aug 05 19:46:11 2013 +0200
@@ -341,19 +341,6 @@
         return 'MOV {0}, xx?'.format(self.r)
 
 
-@armtarget.instruction
-class movregreg_ins(ArmInstruction):
-    """ mov Rd, Rm """
-    mnemonic = 'mov'
-    operands = (Reg8Op, Reg8Op)
-    def __init__(self, rd, rm):
-        self.rd = rd
-        self.rm = rm
-    def encode(self):
-        rd = self.rd.num
-        rm = self.rm.num
-        h = 0 | (rm << 3) | rd
-        return u16(h)
 
 
 
@@ -419,6 +406,12 @@
         return '{} {}, {}'.format(self.mnemonic, self.rdn, self.rm)
 
 @armtarget.instruction
+class movregreg_ins(regreg_base):
+    """ mov Rd, Rm """
+    mnemonic = 'mov'
+    opcode = 0
+
+@armtarget.instruction
 class andregs_ins(regreg_base):
     mnemonic = 'AND'
     opcode = 0b0100000000