Keil™, An ARM® Company

8051 Instruction Set Manual

DEC

The DEC instruction decrements the specified operand by 1. An original value of 00h underflows to 0FFh. 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 pins of the port.

See Also: INC

DEC @Ri
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
0001011i
Operation
DEC
(Ri) = (Ri) - 1
Example
DEC @R1
DEC A
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
00010100
Operation
DEC
A = A - 1
Example
DEC A
DEC direct
CACF0RS1RS0OV P
Bytes2
Cycles1
Encoding
00010101direct
Operation
DEC
(direct) = (direct) - 1
Example
DEC 35h
DEC Rn
CACF0RS1RS0OV P
Bytes1
Cycles1
Encoding
00011nnn
Operation
DEC
Rn = Rn - 1
Example
DEC R7