
Instruction Reference Manual
67
Description
This instruction is similar to the
JP mn
instruction in that it transfers program execution to the memory loca-
tion specified by the 16-bit address, mn.
LJP
is special in that it allows a jump to be made to a computed
address in XMEM. Note that the value of XPC and consequently the address space defined by the XPC is
dynamically changed with the
LJP
instructions.
The instruction loads the XPC, with the 8-bit constant x. Then loads the Program Counter, PC, with the 16-bit
constant mn, which must be in the range E000–FFFF.
This instruction recognizes labels when used in the Dynamic C assembler. This instruction is implemented
for the Rabbit and is not available for the Z180.
Description
The LRET transfers execution from a subroutine to the calling program by popping the Program Counter and
the XPC off of the Stack, in order to return from a LCALL operation.
The instruction first loads the low order byte of the Program Counter with the data whose address is the data
in the Stack Pointer, SP. Then it loads the high order byte of the PC with the data in whose address is the sum
data in the SP and 1. Then it loads the Extension of the Program Counter, the XPC, with the data whose
address is the data in the SP plus 2. Finally it adds three to the value in the SP and stores the result in the SP
This instruction is implemented for the Rabbit and is not available for the Z180.
LJP x,mn
Opcode
Instruction
Clocks
Operation
C7 n m x
LJP x,mn
10 (2,2,2,2,2)
XPC = x; PC = mn
Flags
ALTD
I/O
S
Z
L/V
C
F
R
SP
S
D
-
-
-
-
LRET
Opcode
Instruction
Clocks
Operation
ED 45
LRET
13 (2,2,1,2,2,2,2)
PC
(low)
= (SP); PC
(high)
= (SP+1);
XPC = (SP + 2); SP = SP + 3
Flags
ALTD
I/O
S
Z
L/V
C
F
R
SP
S
D
-
-
-
-
Summary of Contents for 2000
Page 2: ...ii Rabbit 2000 3000 Microprocessor...
Page 4: ...iv Rabbit 2000 Microprocessor...
Page 16: ...12 Rabbit 2000 3000 Microprocessor...
Page 112: ...108 Rabbit 2000 3000 Microprocessor...
Page 120: ...ii Rabbit 2000 3000 Microprocessor...