beautypg.com

Reti – Zilog Z08470 User Manual

Page 297

background image

UM008007-0715

Z80 Instruction Description

Z80 CPU

User Manual

285

RETI

Operation

Return from Interrupt

Op Code

RETI

Operands

None.

Description

This instruction is used at the end of a maskable interrupt service routine to:

Restore the contents of the Program Counter (analogous to the RET instruction)

Signal an I/O device that the interrupt routine is completed. The RETI instruction also
facilitates the nesting of interrupts, allowing higher priority devices to temporarily
suspend service of lower priority service routines. However, this instruction does not
enable interrupts that were disabled when the interrupt routine was entered. Before
doing the RETI instruction, the enable interrupt instruction (EI) should be executed to
allow recognition of interrupts after completion of the current service routine.

Condition Bits Affected

None.

Example

Assume that there are two interrupting devices, A and B, connected in a daisy-chain con-
figuration, with A having a higher priority than B.

M Cycles

T States

4 MHz E.T.

4

14 (4, 4, 3, 3)

3.50

1

1

0

0

1

1

1

1

ED

0

1

0

0

1

1

0

1

4D

This manual is related to the following products: