r <- r - 1
DEC
r
b7 | b6 | b5 | b4 | b3 | b2 | b1 | b0 |
---|---|---|---|---|---|---|---|
0 | 0 | r | 1 | 0 | 1 |
Register r is decremented and register r identifies any of the registers A, B, C, D, E, H, or L, assembled as follows in the object code.
Register | r | Hex |
---|---|---|
A | 111 | $3D |
B | 000 | $05 |
C | 001 | $0D |
D | 010 | $15 |
E | 011 | $1D |
H | 100 | $25 |
L | 101 | $2D |
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 r was $80 before operation, otherwise it is reset. |
N | is set. |
C | is not affected. |
If the D register contains byte $2A, then upon the execution of
DEC D
the D Register contains $29.