MSP430 Instructions
4-70
16-Bit MSP430X CPU
CALL
Call a Subroutine in lower 64 K
Syntax
CALL
dst
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
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
Summary of Contents for MSP430x4xx Family
Page 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Page 2: ......
Page 6: ...vi ...
Page 114: ...3 76 RISC 16 Bit CPU ...
Page 304: ...5 20 FLL Clock Module ...
Page 340: ...7 8 Supply Voltage Supervisor ...
Page 348: ...8 8 16 Bit Hardware Multiplier ...
Page 372: ...9 24 32 Bit Hardware Multiplier ...
Page 400: ...10 28 DMA Controller ...
Page 428: ...13 10 Basic Timer1 ...
Page 466: ...15 24 Timer_A ...
Page 522: ...17 30 USART Peripheral Interface UART Mode ...
Page 544: ...18 22 USART Peripheral Interface SPI Mode ...
Page 672: ...23 12 Comparator_A ...
Page 692: ...24 20 LCD Controller ...
Page 746: ...26 28 ADC12 ...