`cmp` can compare against a literal word.
Chris Pressey
4 years ago
9 | 9 |
* When the range of a location is known, `inc` and `dec`
|
10 | 10 |
on it will usually shift the known instead of invalidating it.
|
11 | 11 |
* `cmp` instruction can now perform a 16-bit unsigned comparison
|
12 | |
of `word` memory locations (at the cost of trashing `a`.)
|
|
12 |
of `word` memory locations and `word` literals (at the cost of
|
|
13 |
trashing the `a` register.)
|
13 | 14 |
* Fixed pathological memory use in the lexical scanner - should
|
14 | 15 |
be much less inefficient now when parsing large source files.
|
15 | 16 |
* Reorganized the examples in `eg/rudiments/` to make them
|
399 | 399 |
self.emitter.emit(BNE(Relative(end_label)))
|
400 | 400 |
self.emitter.emit(LDA(Absolute(Offset(dest_label, 1))))
|
401 | 401 |
self.emitter.emit(CMP(Absolute(Offset(src_label, 1))))
|
|
402 |
self.emitter.resolve_label(end_label)
|
|
403 |
return
|
|
404 |
if isinstance(src, ConstantRef) and src.type == TYPE_WORD:
|
|
405 |
dest_label = self.get_label(dest.name)
|
|
406 |
self.emitter.emit(LDA(Absolute(dest_label)))
|
|
407 |
self.emitter.emit(CMP(Immediate(Byte(src.high_byte()))))
|
|
408 |
end_label = Label('end_label')
|
|
409 |
self.emitter.emit(BNE(Relative(end_label)))
|
|
410 |
self.emitter.emit(LDA(Absolute(Offset(dest_label, 1))))
|
|
411 |
self.emitter.emit(CMP(Immediate(Byte(src.low_byte()))))
|
402 | 412 |
self.emitter.resolve_label(end_label)
|
403 | 413 |
return
|
404 | 414 |
cls = {
|