I think somewhere here on the forum once asked whether I was planning branches based on signed comparisons.
After looking at the v-flag primer, I am not sure they make sense:
http://www.6502.org/tutorials/vflag.htmlThe problem I see is that only ADC and SBC modify the V-flag, but NOT the CMP operation!
And as far as I understand the signed number arithmethic, a branch greater or smaller on signed values depends on V.
Basically a set V-flag says, that the operation went out of the 8-bit space. So in principal, you should always use that to
handle error conditions - before actually using C/E for the unsigned greater/smaller branches.
So would a branch on a signed comparison even work?
And if I can't compare two numbers to get a signed comparison result (because CMP does not set V), the value of, say "BGTS" (branch greater than, signed)
would be rather small.
What do you think?
TIA
Andre
_________________
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content:
http://6502.org/users/andre/