102 / 132 page

Handshake Solutions
HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Page 102 of 132
© Philips Electronics N.V. 2005
DEC byte
Function: Decrement
Description: The variable indicated is decremented by 1. An original value of 00H will underflow to 0FFH. No
flags are affected. Four operand addressing modes are allowed: accumulator, register, direct, or
register-indirect.
Note: When this instruction is used to modify an output port, the value used as the original data
will be read from the output data latch, not the input pin.
Example: Register 0 contains 7FH (01111111B). Internal RAM locations 7EH and 7FH contain 00H and
40H, respectively. The instruction sequence,
DEC @R0
DEC R0
DEC @R0
will leave register 0 set to 7EH and internal RAM locations 7EH and 7FH set to 0FFH and 3FH.
DEC A
Bytes: 1
Cycles: 1
Encoding:
Operation: DEC
(A)
← (A) – 1
DEC Rn
Bytes: 1
Cycles: 1
Encoding:
Operation: DEC
(Rn)
← (Rn) – 1
DEC direct
Bytes: 2
Cycles: 1
Encoding:
Operation: DEC
(direct)
← (direct) – 1
DEC @Ri
Bytes: 1
Cycles: 1
Encoding:
Operation: DEC
((Ri))
← ((Ri)) – 1
0
0
0
1
0
1
0
0
0
0
0
1
1
r
r
r
0
0
0
1
0
1
0
1
direct address
0
0
0
1
0
1
1
i