60
Rabbit 2000/3000 Microprocessor
Description
This instruction is similar to the CALL routine in that it transfers program execution to the subroutine address
specified by the 16-bit operand mn. The LCALL instruction is special in that it allows calls 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 LCALL instructions.
In the LCALL instruction, first XPC is pushed onto the stack. Next PC is pushed onto the stack, the high
order byte first, then the low order byte. Then the XPC is loaded with the 8-bit value x and the PC is loaded
with the 16-bit value, mn. The SP is then updated to reflect the three items pushed onto it.
The value mn must be in the range E000–FFFF.
Alternate Forms
The Dynamic C assembler recognizes several other forms of this instruction.
LCALL
label
LCALL
x
,
label
LCALL
x
:
label
LCALL
x
:
mn
The parameter label is a user defined label. The colon is equivalent to the comma as a delimiter.
LCALL
x
,
mn
Opcode
Instruction
Clocks
Operation
CF
n m x
LCALL
x
,
mn
19 (2,2,2,2,1,3,3,3,1)
(SP - 1) = XPC;
(SP - 2) = PC
(high)
;
(SP - 3) = PC
(low)
;
XPC =
x
;
PC =
mn
;
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 164: ...160 Instruction Reference Manual...