UM012811-0904
eZ8 CPU Instruction Set Description
eZ8 CPU
User Manual
116
IRET
Interrupt Return
IRET
Operation
FLAGS
←
@SP
SP
←
SP + 1
PC
←
@SP
SP
←
SP + 2
IRQCTL[7]
←
1
Description
This instruction is issued at the end of an interrupt service routine. Execution of IRET
restores the Flags Register and the Program Counter. The Interrupt Controller is enabled
by setting Bit 7 of the Interrupt Control Register to 1.
Flags
Attributes
Example
If Stack Pointer High register, FFEH, contains the value
EFH
, Stack Pointer Low register
FFFH contains the value
45H
, Register 45H contains the value
00H
, Register 46H contains
6FH
, and Register 47H contains
E4H
, the statement:
IRET
Object Code: BF
restores the Flags Register FCH with the value
00H
, restores the PC with the value
6FE4H
,
re-enables the interrupts, and sets the Stack Pointer Low to the value
48H
. The Stack
Pointer High register remains unchanged with the value
EFH
. The next instruction to be
executed is at 6FE4H.
C
Restored to original setting before the interrupt occurred.
Z
Restored to original setting before the interrupt occurred.
S
Restored to original setting before the interrupt occurred.
V
Restored to original setting before the interrupt occurred.
D
Restored to original setting before the interrupt occurred.
H
Restored to original setting before the interrupt occurred.
Mnemonic
Destination, Source
Opcode (Hex)
Operand 1
Operand 2
Operand 3
IRET
—
BF
—
—
—