NerickLe 24/10/2004 à 12:56
I simply didn't think about using addx to set properly the carry flag. But for the V flag, I think it is not as trivial as in your piece of code. Here is how it should be set for an 6502 ADC instruction:
"set if: A register (before operation) and value to add (d0 before the addx here) have the same sign
AND
A register (before operation) and result of addition have opposite sign"
however, if the addx instruction set the X flag as in the V flag must be set in the synopsis above, then you're right (I'm going to check this out).