ZiLOG Z80-CPU Technical Manual page 40

Table of Contents

Advertisement

Disable Interrupt
LDA,n
OUTn,A
Enable Interrupt
Return
prevent interrupt before
routine is exited.
notify peripheral that service
routine is complete
This seven byte sequence can be replaced with the one byte EI instruction and the two byte RETI instruction
in the l80. TItis is important since interrupt service time often must be minimized.
To facilitate program loop control the instruction DJNl e can be used advantageously. This two byte,
relative jump instruction decrements the B register and the jump occurs if the B register has not been decre-
mented to zero. The relative displacement is expressed as a signed two's complement number. A simple ex-
ample of its use nlight be:
Address
N, N+ 1
N + 2 to N+ 9
N + 10, N+ 11
N+ 12
JUMP
'JP'
.JUMP
6JR'
JUMP
'JP'
JUMP
'JP'
JUMP
'JP'
'CALL'
DECREMENT B,
JUMP IF NON
ZERO'DJNZ'
RETURN
'RET'
Instruction
LDB, 7
(perform a sequence
of instructions)
DJNl
-8
(Next Instruction)
IMMED.
nn
EXT.
RELATIVE
PC+e
(HL)
REG.
(IX)
INDIR.
(IV)
IMMED.
nn
EXT.
RELATIVE
PC+e
REGISTER
(SP)
INDIR.
(SP+l)
RETURN FROM
REG.
(SP)
ED
(SP+l)
4D
INT'RET/'
INDIR.
RETURN FROM
NON MASKABLE
REG.
INT'RETN'
INDIR.
ED
(SP+l)
45
Comments
; set B register to count of 7
; loop to be performed 7 times
; to jump from N + 12 to N + 2
CONDITION
28
;w
e-2
e-2
NOTE-CERTAIN
FLAGS HAVE MORE
THAN ONE PURPOSE.
REFER TO SECTION
6_0 FOR DETAILS
JUMP, CALL and RETURN GROUP
TABLE 5.3-11
34

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Z80-CPU and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Z80a-cpu

Table of Contents