 | 8051 Instruction Set Manual |  |
|
|
| DJNZThe DJNZ instruction decrements the byte indicated by the first operand and, if the resulting value is not zero, branches to the address specified in the second operand. 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: CJNE | Bytes | 3 | | Cycles | 2 | | Encoding | | | Operation |
DJNZ
PC = PC + 2
(direct) = (direct) - 1
IF (direct) <> 0
PC = PC + offset
| | Example |
DJNZ 40h, LABEL
|
| Bytes | 2 | | Cycles | 2 | | Encoding | | | Operation |
DJNZ
PC = PC + 2
Rn = Rn - 1
IF Rn <> 0
PC = PC + offset
| | Example |
DJNZ R6, LABEL
|
|
|