Instruction Set
C500 Family
Semiconductor Group
4-44
1998-04-01
LCALL
addr16
Function:
Long call
Description:
LCALL calls a subroutine located at the indicated address. The instruction adds
three to the program counter to generate the address of the next instruction and
then pushes the 16-bit result onto the stack (low byte first), incrementing the stack
pointer by two. The high-order and low-order bytes of the PC are then loaded,
respectively, with the second and third bytes of the LCALL instruction. Program
execution continues with the instruction at this address. The subroutine may
therefore begin anywhere in the full 64 Kbyte program memory address space. No
flags are affected.
Example:
Initially the stack pointer equals 07H. The label ÒSUBRTNÓ is assigned to program
memory location 1234H. After executing the instruction
LCALL
SUBRTN
at location 0123H, the stack pointer will contain 09H, internal RAM locations 08H
and 09H will contain 26H and 01H, and the PC will contain 1234H.
Operation:
LCALL
(PC)
¬
(PC) + 3
(SP)
¬
(SP) + 1
((SP))
¬
(PC7-0)
(SP)
¬
(SP) + 1
((SP))
¬
(PC15-8)
(PC)
¬
addr15-0
Bytes:
3
Cycles:
2
Encoding:
0 0 0 1
0 0 1 0
addr15 . . addr8
addr7 . . addr0