Indirect Addressing Modes
5-16
AMODE
”loc16/loc32” Syntax
Description
X
*0−−
32bitDataAddr(31:0) = XAR(ARP)
XAR(ARP) = XAR(ARP)
−
AR0
Note:
The lower 16-bits of XAR0 are subtracted from the selected 32-bit regis-
ter. Upper 16-bits of XAR0 ignored. AR0 is treated as an unsigned 16-bit
value. Underflow into the upper 16-bits of XAR(ARP) can occur.
Example(s):
MOVL XAR2,#(N−1)*8 ; Load XAR2 with end address of Array1
MOVL XAR3,#(N−1)*2 ; Load XAR3 with end address of Array2
MOV @AR0,#4 ; Set AR0 to copy every fourth value from
; Array1 to Array2
MOV @AR1,#N−1 ; Load AR1 with loop count N
Loop:
NOP *,ARP2 ; Set ARP pointer to point to XAR2
MOVL ACC,*0−− ; Load ACC with location pointed to by
; XAR2, post−decrement XAR2 by AR0
NOP *,ARP3 ; Set ARP pointer to point to XAR3
MOVL *−−,ACC ; Store ACC into location pointed to by
; XAR3, post−decrement XAR3
NOP *,ARP1 ; Set ARP pointer to point to XAR1
XBANZ Loop,*−− ; Loop until AR1 == 0, post−decrement AR1
AMODE
”loc16/loc32” Syntax
Description
1
*0−−,ARPn
32bitDataAddr(31:0) = XAR(ARP)
XAR(ARP) = XAR(ARP)
−
AR0
ARP = n
Note:
The lower 16-bits of XAR0 are subtracted from the selected 32-bit regis-
ter. Upper 16-bits of XAR0 ignored. AR0 is treated as an unsigned 16-bit
value. Underflow into the upper 16-bits of XAR(ARP) can occur.
Example(s):
MOVL XAR2,#(N−1)*8 ; Load XAR2 with end address of Array1
MOVL XAR3,#(N−1)*2 ; Load XAR3 with end address of Array2
MOV @AR0,#4 ; Set AR0 to copy every fourth value from
; Array1 to Array2
MOV @AR1,#N−1 ; Load AR1 with loop count N
NOP *,ARP2 ; Set ARP pointer to point to XAR2
SETC AMODE ; Make sure AMODE = 1
.lp_amode ; Tell assembler that AMODE = 1
Loop:
MOVL ACC,*0−−,ARP3 ; Load ACC with location pointed to by
; XAR2, post−decrement XAR2 by AR0, set ARP
; pointer to point to XAR3
MOVL *−−,ACC,ARP1 ; Store ACC into location pointed to by
; XAR3, post−decrement XAR3, set ARP
; pointer to point to XAR1
XBANZ Loop,*−−,ARP2 ; Loop until AR1 == 0, post−decrement AR1,
; set ARP to point to XAR2
Содержание TMS320C28x
Страница 30: ...1 12...
Страница 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Страница 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Страница 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Страница 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...
Страница 585: ...This page intentionally left blank 7 32 This page intentionally left blank...