beautypg.com

Reti return from interrupt – Zilog Z80380 User Manual

Page 176

background image

5-142

Z380

U

SER

'

S

M

ANUAL

DC-8297-03

Z

ILOG

RETI
RETURN FROM INTERRUPT

RETI

Operation:

if (XM) then begin

PC(7-0)

(SP)

PC(15-8)

(SP+1)

PC(23-16)

(SP+2)

PC(31-24)

(SP+3)

SP

SP + 4

end

else begin

PC(7-0)

(SP)

PC(15-8)

(SP+1)

SP

SP + 2

end

This instruction is used to return to a previously executing procedure at the end of a
procedure entered by an interrupt. The contents of the location addressed by the Stack
Pointer (SP) are popped into the Program Counter (PC), thereby specifying the location of
the next instruction to be executed. A special sequence of bus transactions is performed
when this instruction is executed in order to control Z80 family peripherals; see the
description of the external interface for more details.

Flags:

S:

Unaffected

Z:

Unaffected

H:

Unaffected

V:

Unaffected

N:

Unaffected

C:

Unaffected

Addressing

Execute

Mode

Syntax

Instruction Format

Time

Note

RETI

11101101 01001101

2+r

X