<< Previous | Next >>

> LLRET Far Return Rabbit 4000 Instruction

> Opcode | Instruction | Clocks | Operation
> ED 8B | LLRET | 14 (2,2,2,2,2,2,2) | PClow = (SP) PChigh = (SP + 1) XPClow = (SP + 2) XPChigh = (SP + 3) SP = SP + 4

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

> #### Description

> The `LLRET` instruction is used to return from an `LLCALL` operation. It transfers execution from a subroutine to the calling program by popping PC and the XPC from the stack.

> The low-order byte of PC is loaded with the data whose address is SP and the high-order byte of PC is loaded with the data whose address is SP+1. Then, the low-order byte of XPC is loaded with the data whose address is SP+2 and the high-order byte of XPC is loaded with the data whose address is SP+3. Finally, the value in SP is incremented by 4.

<< Previous | Next >>