Stack Addressing Modes (SP)
5-9
C28x Addressing Modes
5.5 Stack Addressing Modes (SP)
AMODE
”loc16/loc32” Syntax
Description
0
*−SP[6bit]
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.
Example(s):
ADD AL,*−SP[5]
; Add 16-bit contents from stack location
; −5 words from top of stack to AL register
MOV *-SP[8],AL
; Store 16-bit AL register to stack location
; -8 words from top of stack
ADDL ACC,*−SP[12] ; Add 32-bit contents from stack location
; −12 words from top of stack to ACC register.
MOVL *-SP[34],ACC ; Store 32-bit ACC register to stack location
; −34 words from top of stack
AMODE
”loc16/loc32” Syntax
Description
X
*SP++
32bitDataAddr(31:16) = 0x0000
32bitDataAddr(15:0) = SP
if(loc16), SP = SP + 1
if(loc32), SP = SP + 2
Example(s):
MOV *SP++,AL
; Push contents of 16-bit AL register onto top
; of stack
MOVL *SP++,P
; Push contents of 32-bit P register onto top
; of stack
AMODE
”loc16/loc32” Syntax
Description
X
*−−SP
if(loc16), SP = SP
−
1
if(loc32), SP = SP
−
2
32bitDataAddr(31:16) = 0x0000
32bitDataAddr(15:0) = SP
Example(s):
ADD AL,*−−SP
; Pop contents from top of stack and add to 16-bit
; AL register
MOVL ACC,*−−SP
; Pop contents from top of stack and store in
; 32-bit ACC register
Note:
This addressing mode can only access the lower 64K of data address space on the C28x device.
Summary of Contents for TMS320C28x
Page 30: ...1 12...
Page 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Page 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Page 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Page 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Page 585: ...This page intentionally left blank 7 32 This page intentionally left blank...