8051 Instruction Set Manual

INC

The INC instruction increments the specified operand by 1. An original value of 0FFh or 0FFFFh overflows to 00h or 0000h. No flags are affected by this instruction.

Note

When this instruction is used to modify an output port, the value used as the port data is read from the output data latch, not the input pins of the port.

See Also: DEC

INC @Ri
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
0000011i
Operation
INC
(Ri) = (Ri) + 1
Example
INC @R0
INC A
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
00000100
Operation
INC
A = A + 1
Example
A = A + 1
INC direct
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
00000101direct
Operation
INC
(direct) = (direct) + 1
Example
INC 34h
INC DPTR
CACF0RS1RS0OV P
Bytes1
Cycles2
Encoding
10100011
Operation
INC
DPTR = DPTR + 1
Example
INC DPTR
INC Rn
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
00001nnn
Operation
INC
Rn = Rn + 1
Example
INC Rn