CPU Registers
4-7
16-Bit MSP430X CPU
4.3.2
Stack Pointer (SP)
The 20-bit stack pointer (SP/R1) is used by the CPU to store the return
addresses of subroutine calls and interrupts. It uses a predecrement,
postincrement scheme. In addition, the SP can be used by software with all
instructions and addressing modes. Figure 4−5 shows the SP. The SP is
initialized into RAM by the user, and is always aligned to even addresses.
Figure 4−6 shows the stack usage. Figure 4−7 shows the stack usage when
20-bit address-words are pushed.
Figure 4−5. Stack Pointer
0
Stack Pointer Bits 19 to 1
19
1
0
MOV.W 2(SP),R6
; Copy Item I2 to R6
MOV.W R7,0(SP)
; Overwrite TOS with R7
PUSH
#0123h
; Put 0123h on stack
POP
R8
; R8 = 0123h
Figure 4−6. Stack Usage
I3
I1
I2
I3
0xxxh
0xxxh − 2
0xxxh − 4
0xxxh − 6
0xxxh − 8
I1
I2
SP
0123h
SP
I1
I2
I3
SP
PUSH #0123h
POP R8
Address
Figure 4−7. PUSHX.A Format on the Stack
Item n−1
Item.19:16
Item.15:0
SP
old
SP
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 ...