<< Previous | Next >>

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

> Opcode | Instruction | Clocks | Operation
> ED 4D | RETI | 12 (2,2,1,2,2,2,1) | IP = (SP) PClow = (SP+1) PChigh = (SP+2) SP = SP+3

> 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.

<< Previous | Next >>