Stack Addressing Modes (Sp) - Texas Instruments TMS320C28x Reference Manual

Dsp cpu and instruction set
Table of Contents

Advertisement

5.5 Stack Addressing Modes (SP)

AMODE
"loc16/loc32" Syntax
0
*−SP[6bit]
Example(s):
ADD
AL,*−SP[5]
MOV
*-SP[8],AL
ADDL
ACC,*−SP[12]
MOVL
*-SP[34],ACC
AMODE
"loc16/loc32" Syntax
X
*SP++
Example(s):
MOV
*SP++,AL
MOVL
*SP++,P
AMODE
"loc16/loc32" Syntax
X
*−−SP
Example(s):
ADD
AL,*−−SP
MOVL
ACC,*−−SP
Note:
This addressing mode can only access the lower 64K of data address space on the C28x device.
Description
32bitDataAddr(31:16) = 0x0000
32bitDataAddr(15:0) = SP − 6bit
Note:
The 6-bit offset value is subtracted from the current 16-bit SP register val-
ue. The offset value enables 0 to 63 words to be addressed relative to the
current SP register value.
; Add 16-bit contents from stack location
; −5 words from top of stack to AL register
; Store 16-bit AL register to stack location
; -8 words from top of stack
; Add 32-bit contents from stack location
; −12 words from top of stack to ACC register.
; Store 32-bit ACC register to stack location
; −34 words from top of stack
Description
32bitDataAddr(31:16) = 0x0000
32bitDataAddr(15:0) = SP
if(loc16), SP = SP + 1
if(loc32), SP = SP + 2
; Push contents of 16-bit AL register onto top
; of stack
; Push contents of 32-bit P register onto top
; of stack
Description
if(loc16), SP = SP − 1
if(loc32), SP = SP − 2
32bitDataAddr(31:16) = 0x0000
32bitDataAddr(15:0) = SP
; Pop contents from top of stack and add to 16-bit
; AL register
; Pop contents from top of stack and store in
; 32-bit ACC register
Stack Addressing Modes (SP)
C28x Addressing Modes
5-9

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMS320C28x and is the answer not in the manual?

Table of Contents

Save PDF