1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-06 15:29:30 +00:00

Notes on compare.

This commit is contained in:
Chris Pressey 2018-11-23 22:23:41 +00:00
parent 0bc79d20d6
commit a765a50c1e
3 changed files with 8 additions and 11 deletions

View File

@ -4,6 +4,8 @@ History of SixtyPical
0.18
----
* Added `compare` instruction, which is like `cmp` but can
directly compare two `word` memory locations (trashing `a`.)
* Fixed pathological memory use in the lexical scanner - should
be much less inefficient now when parsing large source files.

11
TODO.md
View File

@ -1,17 +1,6 @@
TODO for SixtyPical
===================
### 16-bit `cmp`
This is because we don't actually want `low` and `high` address operators
that turn `word` type into `byte`.
This is because this immediately makes things harder (that is, effectively
impossible) to analyze.
16-bit `cmp` also benefits from some special differences between `cmp`
and `sub` on 6502, so it would be nice to capture them.
### Save values to other-than-the-stack
Allow

View File

@ -415,6 +415,12 @@ words) and it trashes the `a` register.
Affects n, z, and c flags, requiring that they be in the WRITES,
and initializing them afterwards.
Note that, like `cmp`, `compare` is not suitable for making a
signed comparison; this article, which mentions
techniques that a SixtyPical compiler could use to
implement `compare`, also explains why that is:
[Beyond 8-bit Unsigned Comparisons, by Bruce Clark](http://www.6502.org/tutorials/compare_beyond.html).
### and, or, xor ###
and <dest-memory-location>, <src-memory-location>