
Instruction Set Description
4.6.2.9
CALL
CALL
Call a subroutine in lower 64 K
CALL dst
Syntax
Operation
dst
→
tmp 16-bit dst is evaluated and stored
SP – 2
→
SP
PC
→
@SP updated PC with return address to TOS
tmp
→
PC saved 16-bit dst to PC
Description
A subroutine call is made from an address in the lower 64 K to a subroutine address in
the lower 64 K. All seven source addressing modes can be used. The call instruction is a
word instruction. The return is made with the RET instruction.
Status Bits
Status bits are not affected.
PC.19:16 cleared (address in lower 64 K)
Mode Bits
OSCOFF, CPUOFF, and GIE are not affected.
Examples
Examples for all addressing modes are given.
Immediate Mode: Call a subroutine at label EXEC (lower 64 K) or call directly to address.
CALL
#EXEC
; Start address EXEC
CALL
#0AA04h
; Start address 0AA04h
Symbolic Mode: Call a subroutine at the 16-bit address contained in address EXEC.
EXEC is located at the address (PC + X) where X is within PC ± 32 K.
CALL
EXEC
; Start address at @EXEC. z16(PC)
Absolute Mode: Call a subroutine at the 16-bit address contained in absolute address
EXEC in the lower 64 K.
CALL
&EXEC
; Start address at @EXEC
Register mode: Call a subroutine at the 16-bit address contained in register R5.15:0.
CALL
R5
; Start address at R5
Indirect Mode: Call a subroutine at the 16-bit address contained in the word pointed to by
register R5 (20-bit address).
CALL
@R5
; Start address at @R5
142
CPUX
SLAU272C – May 2011 – Revised November 2013
Copyright © 2011–2013, Texas Instruments Incorporated