<< Previous | Next >>

RETI     Return from Subroutine     Rabbit 2000/3000/4000/5000 Instruction

Opcode
Instruction
Operation
ED 4D RETI IP = (SP)
PClow = (SP+1)
PChigh = (SP+2)
SP = SP+3

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 2000/3000/4000
12
n/a
n/a
Rabbit 5000
12
12
10

Flags ALTD IOI/IOE
S
Z
L/V
C
F
R
SP
S
D
-
-
-
-

Description

Loads IP with the data whose address is on the top of the stack, which should be the interrupt priority that was saved when the interrupt occurred. Then, loads PC from the stack, which should be the return address that was saved when the interrupt occurred. Next, the interrupt priority and the return address are popped off the stack by adding 3 to SP.

This is a chained-atomic instruction, meaning that an interrupt cannot take place between this instruction and the instruction following it.


Rabbit Instructions << Previous | Next >> rabbit.com