DEC
byte
Function:
Decrement
Description:
The variable indicated is decremented by 1. An original value of 00 H will underflow
to 0FF H . 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
port data will be read from the output data latch, not the input pins.
Example:
Register 0 contains 7F H (01111111B). Internal RAM locations 7E H and 7F H
contain 00 H and 40 H , respectively. The instruction sequence
DEC
DEC
DEC
will leave register 0 set to 7E H and internal RAM locations 7E H and 7F H set to
0FF H and 3F H .
DEC
A
Operation:
DEC
(A) ← (A) – 1
Encoding:
0 0 0 1
Bytes:
1
Cycles:
1
DEC
Rn
Operation:
DEC
(Rn) ← (Rn) – 1
Encoding:
0 0 0 1
Bytes:
1
Cycles:
1
Semiconductor Group
@R0
R0
@R0
0 1 0 0
1 r r r
*
155
Instruction Set