English
Language : 

Z86E3016PSG Datasheet, PDF (265/348 Pages) Zilog, Inc. – Z86E3016PSG
Z8 CPU
User Manual
247
Decrement and Jump if Non-Zero
DJNZ r, dst
Instruction Format
r OPC
dst
Cycles
12 If jump taken
10 if jump not taken
Address Mode
OPC (Hex)
dst
rA
r
(R = 0 to F)
r
Operation
r ← r–1;
If r <> 0, PC ← PC + dst
The specified Working Register being used as a counter is decremented. If
the contents of the specified Working Register are not zero after decre-
menting, then the relative address is added to the Program Counter (PC)
and control passes to the statement whose address is now in the PC. The
range of the relative address is +127 to –128. The original value of the PC
is the address of the instruction byte following the DJNZ statement. When
the specified Working Register counter reaches zero, control falls through
to the statement following the DJNZ instruction.
Flag
C
Z
S
V
D
H
Description
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Unaffected
Note: The Working Register being used as a counter must be one of the Registers
from 04h to EFh. Use of one of the I/O ports, control or peripheral regis-
ters will have undefined results.
UM001602-0904
Instruction Description