105 / 132 page

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