comparison python/asm.py @ 203:ca1ea402f6a1

Added some arm instructions
author Windel Bouwman
date Sat, 15 Jun 2013 19:13:05 +0200
parents 5e391d9a3381
children 6c6bf8890d8a
comparison
equal deleted inserted replaced
202:f22b431f4113 203:ca1ea402f6a1
158 # TODO 158 # TODO
159 if not self.target: 159 if not self.target:
160 raise CompilerError('Cannot assemble without target') 160 raise CompilerError('Cannot assemble without target')
161 while self.output: 161 while self.output:
162 vi = self.output.pop(0) 162 vi = self.output.pop(0)
163 ri = self.target.mapInstruction(vi) 163 if type(vi) is AInstruction:
164 b = ri.encode() 164 ri = self.target.mapInstruction(vi)
165 assert type(b) is bytes 165 b = ri.encode()
166 self.binout.extend(b) 166 assert type(b) is bytes
167 self.binout.extend(b)
167 168
168 def back_patch(self): 169 def back_patch(self):
169 """ Fix references to earlier labels """ 170 """ Fix references to earlier labels """
170 pass 171 pass
171 172