<< Previous | Next >>

LRET     Long Return     Rabbit 2000/3000/4000/5000 Instruction

Opcode
Instruction
Operation
ED 45 LRET PClow = (SP)
PChigh = (SP + 1)
XPC = (SP + 2)
SP = SP + 3

8-Bit Access
16-Bit Unaligned
16-Bit Aligned
Rabbit 2000/3000/4000
13
n/a
n/a
Rabbit 5000
13
11
11

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

Description

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

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


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