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
Содержание MSP430x4xx Family
Страница 1: ...MSP430x4xx Family 2007 Mixed Signal Products User s Guide SLAU056G ...
Страница 2: ......
Страница 6: ...vi ...
Страница 114: ...3 76 RISC 16 Bit CPU ...
Страница 304: ...5 20 FLL Clock Module ...
Страница 340: ...7 8 Supply Voltage Supervisor ...
Страница 348: ...8 8 16 Bit Hardware Multiplier ...
Страница 372: ...9 24 32 Bit Hardware Multiplier ...
Страница 400: ...10 28 DMA Controller ...
Страница 428: ...13 10 Basic Timer1 ...
Страница 466: ...15 24 Timer_A ...
Страница 522: ...17 30 USART Peripheral Interface UART Mode ...
Страница 544: ...18 22 USART Peripheral Interface SPI Mode ...
Страница 672: ...23 12 Comparator_A ...
Страница 692: ...24 20 LCD Controller ...
Страница 746: ...26 28 ADC12 ...