Blogger

Delete comment from: Ken Shirriff's blog

Ken Shirriff said...

Hi Bob! 0-1 should not set overflow, since -1 fits in a byte. I didn't make it super-clear in my article, but for subtraction you need to take the ones-complement of the second value before using the overflow formulas (which are designed for addition). I.e. you're converting the subtraction to addition like in your ADC example.

Hopefully this makes things more clear. If it doesn't, let me know :-)

Oct 7, 2014, 12:36:08 AM


Posted to The 6502 overflow flag explained mathematically

Google apps
Main menu