A <- 0 - A
NEG
None
b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 | |
---|---|---|---|---|---|---|---|---|
1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | $ED |
0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | $44 |
The contents of the Accumulator are negated (two's complement). This method is the same as subtracting the contents of the Accumulator from zero.
NOTE:The $80 address remains unchanged.
S | is set if result is negative, otherwise it is reset. |
Z | is set if result is 0, otherwise it is reset. |
H | is set if borrow from bit 4, otherwise it is reset. |
P/V | is set if Accumulator was $80 before operation, otherwise it is reset. |
N | is set. |
C | is set if Accumulator was not $00 before operation, otherwise it is reset. |
If the Accumulator contains 1001 1000, then upon the execution of
NEG
the Accumulator contains 0110 1000.