Mercurial > lcfOS
comparison python/target.py @ 236:8786811a5a59
Fix pcrel
author | Windel Bouwman |
---|---|
date | Mon, 15 Jul 2013 20:15:31 +0200 |
parents | ff40407c0240 |
children | e41e4109addd |
comparison
equal
deleted
inserted
replaced
235:ff40407c0240 | 236:8786811a5a59 |
---|---|
150 def mapInstruction(self, vi): | 150 def mapInstruction(self, vi): |
151 assert type(vi) is AInstruction | 151 assert type(vi) is AInstruction |
152 """ Map ast tree to real instruction for this target """ | 152 """ Map ast tree to real instruction for this target """ |
153 | 153 |
154 # map to real operands: | 154 # map to real operands: |
155 if vi.mnemonic.upper() == 'ALIGN' and len(vi.operands) == 1: | |
156 if type(vi.operands[0]) == ANumber: | |
157 return Alignment(vi.operands[0].number) | |
155 | 158 |
156 # look for a suitable instruction | 159 # look for a suitable instruction |
157 for ic in self.instructions: | 160 for ic in self.instructions: |
158 if ic.mnemonic.upper() == vi.mnemonic.upper() and len(ic.operands) == len(vi.operands): | 161 if ic.mnemonic.upper() == vi.mnemonic.upper() and len(ic.operands) == len(vi.operands): |
159 # Try to map operands to the correct operand types: | 162 # Try to map operands to the correct operand types: |