git @ Cat's Eye Technologies SixtyPical / 5fa8c69
Don't fudge the name of IndexRefs; dig in to find the ref's name. Chris Pressey 3 years ago
2 changed file(s) with 5 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
155155 elif isinstance(src, ConstantRef):
156156 self.emitter.emit(LDA(Immediate(Byte(src.value))))
157157 elif isinstance(src, IndexedRef) and src.index == REG_X:
158 self.emitter.emit(LDA(AbsoluteX(self.get_label(src.name))))
158 self.emitter.emit(LDA(AbsoluteX(self.get_label(src.ref.name))))
159159 elif isinstance(src, IndexedRef) and src.index == REG_Y:
160 self.emitter.emit(LDA(AbsoluteY(self.get_label(src.name))))
160 self.emitter.emit(LDA(AbsoluteY(self.get_label(src.ref.name))))
161161 elif isinstance(src, IndirectRef) and isinstance(src.ref.type, PointerType):
162162 self.emitter.emit(LDA(IndirectY(self.get_label(src.ref.name))))
163163 else:
168168 elif isinstance(src, ConstantRef):
169169 self.emitter.emit(LDX(Immediate(Byte(src.value))))
170170 elif isinstance(src, IndexedRef) and src.index == REG_Y:
171 self.emitter.emit(LDX(AbsoluteY(self.get_label(src.name))))
171 self.emitter.emit(LDX(AbsoluteY(self.get_label(src.ref.name))))
172172 else:
173173 self.emitter.emit(LDX(Absolute(self.get_label(src.name))))
174174 elif dest == REG_Y:
177177 elif isinstance(src, ConstantRef):
178178 self.emitter.emit(LDY(Immediate(Byte(src.value))))
179179 elif isinstance(src, IndexedRef) and src.index == REG_X:
180 self.emitter.emit(LDY(AbsoluteX(self.get_label(src.name))))
180 self.emitter.emit(LDY(AbsoluteX(self.get_label(src.ref.name))))
181181 else:
182182 self.emitter.emit(LDY(Absolute(self.get_label(src.name))))
183183 else:
201201
202202 @property
203203 def name(self):
204 return self.ref.name
205 #return '{}+{}'.format(self.ref.name, self.index.name)
204 return '{}+{}'.format(self.ref.name, self.index.name)
206205
207206 def is_constant(self):
208207 return False