comparison python/target.py @ 202:f22b431f4113

Added arm add instruction
author Windel Bouwman
date Sat, 15 Jun 2013 10:02:50 +0200
parents d5debbfc0200
children ca1ea402f6a1
comparison
equal deleted inserted replaced
201:d5debbfc0200 202:f22b431f4113
25 self.registers = [] 25 self.registers = []
26 self.instructions = [] 26 self.instructions = []
27 27
28 def instruction(self, cls): 28 def instruction(self, cls):
29 """ Decorator function that registers an instruction to this target """ 29 """ Decorator function that registers an instruction to this target """
30 self.instructions.append(cls) 30 self.addInstruction(cls)
31 return cls 31 return cls
32
33 def addInstruction(self, ins_class):
34 self.instructions.append(ins_class)
32 35
33 def mapOperand(self, operand): 36 def mapOperand(self, operand):
34 """ Try to map an operand to a target type """ 37 """ Try to map an operand to a target type """
35 if type(operand) is ASymbol: 38 if type(operand) is ASymbol:
36 # Try to map to register: 39 # Try to map to register: