3 ms·
I think it looks odd, too. If you go with this: ADC = A + V + C SBC = A - V - (1 - C) SBC = A + (-1 * (V - (C - 1))) SBC = A + (-V + (C - 1))
by carlmr 7y ago
I think it looks odd, too. If you go with this:
ADC = A + V + C
SBC = A - V - (1 - C)
SBC = A + (-1 * (V - (C - 1)))
SBC = A + (-V + (C - 1))
SBC = A + -(V + 1) + C
"The SBC instruction subtracts a value from the accumulator register, with an extra 1 subtracted from the result if the carry flag is NOT set."
The explanation fits though. If the carry flag is not set (C == 0) then you subtract an extra 1. If C == 1 then it's A-V.