Siemens C500 User Manual page 70

Microcontroller family
Table of Contents

Advertisement

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 07 H . The label ÒSUBRTNÓ is assigned to program
memory location 1234 H . After executing the instruction
LCALL
at location 0123 H , the stack pointer will contain 09 H , internal RAM locations 08 H
and 09 H will contain 26 H and 01 H , and the PC will contain 1234 H .
Operation:
LCALL
(PC) ¬ (PC) + 3
(SP) ¬ (SP) + 1
((SP)) ¬ (PC7-0)
(SP) ¬ (SP) + 1
((SP)) ¬ (PC15-8)
(PC) ¬ addr15-0
Encoding:
0 0 0 1
Bytes:
3
Cycles:
2
Semiconductor Group
SUBRTN
0 0 1 0
addr15 . . addr8
4-44
Instruction Set
C500 Family
addr7 . . addr0
1998-04-01

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents