base:16-bit_comparison
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
base:16-bit_comparison [2020-10-22 20:30] – created tww | base:16-bit_comparison [2021-09-13 17:23] (current) – New version didn't pass all validation tests. Reverted to old version. tww | ||
---|---|---|---|
Line 4: | Line 4: | ||
- | TWW method: | + | 16 bit equivalent of the CMP OPC: |
< | < | ||
Line 43: | Line 44: | ||
+ | Different approach: instead of setting flags, goes to different destinations: | ||
+ | |||
+ | < | ||
+ | ; Val1 ≥ Val2 ? | ||
+ | LDA Val1 +1 ; high bytes | ||
+ | CMP Val2+1 | ||
+ | BCC LsThan | ||
+ | BNE GrtEqu | ||
+ | LDA Val1 ; low bytes | ||
+ | CMP Val2 | ||
+ | ;BEQ Equal ; Val1 = Val2 | ||
+ | BCS GrtEqu | ||
+ | LsThan | ||
+ | ... | ||
+ | GrtEqu | ||
+ | ... | ||
+ | </ | ||
base/16-bit_comparison.txt · Last modified: 2021-09-13 17:23 by tww