English
Language : 

DR805X Datasheet, PDF (34/79 Pages) Digital Core Design – 8-bit RISC Microcontroller Instructions set details ver 3.10
DR805x Instructions set details
3.12. DJNZ
- 34 -
Instruction: DJNZ <byte>, <rel-addr>
Function: Decrement and jump if not zero
Description:
DJNZ decrements the location indicated by 1, and branches to the
address indicated by the second operand if the resulting value is not
zero. An original value of 00 H will underflow to 0FF H. No flags are
affected. The branch destination would be computed by adding the
signed relative-displacement value in the last instruction byte to the PC,
after incrementing the PC to the first byte of the following instruction.
The location decremented may be a register or directly addressed byte.
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.
3.12.1.
DJNZ RN, REL
Operation:
(PC) ← (PC) + 2
(Rn) ← (Rn) - 1
if (Rn) ≠ 0 then
(PC) ← (PC) + rel
Bytes:
2
Cycles:
4
Encoding:
11011 r r r
relative address
All trademarks mentioned in this document
are trademarks of their respective owners.
http://www.DigitalCoreDesign.com
http://www.dcd.pl
Copyright 1999-2003 DCD – Digital Core Design. All Rights Reserved.