3 ms·
> Sadly, I can't use this trick for decrements. In this case, I need to decrement the high byte when the low byte underflows from 0x00 to 0xff. Sadly, the CPU d
by ddtaylor 8y ago
> Sadly, I can't use this trick for decrements. In this case, I need to decrement the high byte when the low byte underflows from 0x00 to 0xff. Sadly, the CPU doesn't let us check for this for free, so I need to load it into a register and do an explicit comparison.
Can you check the ~overflow~ negative flag?
http://www.obelisk.me.uk/6502/reference.html#DEC http://www.obelisk.me.uk/6502/reference.html#DEC
- vardump 8y ago> Can you check the overflow flag? Your link states overflow flag is not affected by DEC.
- ddtaylor 8y agoSorry I meant the negative flag
- pubby 8y agoNah that would catch all negative results, not just 0xFF.
- ddtaylor 8y agoThis got me thinking maybe it can be used for indexing from 0 - 128 for indexed addressing modes and that begs the question are the indexed addressing signed or unsigned? Apparently they are unsigned, so the trick might be possible: http://forum.6502.org/viewtopic.php?t=1300 http://forum.6502.org/viewtopic.php?t=1300