Indirect Addressing Modes
5-13C28x Addressing Modes
AMODE ”loc16/loc32” Syntax Description
X *++ 32bitDataAddr(31:0) = XAR(ARP)
if(loc16), XAR(ARP) = XAR(ARP) + 1
if(loc32), XAR(ARP) = XAR(ARP) + 2
Example(s):
MOVL XAR2,#Array1 ; Load XAR2 with start address of Array1
MOVL XAR3,#Array2 ; Load XAR3 with start address of Array2
MOV @AR0,#N−1 ; Load AR0 with loop count N
Loop:
NOP *,ARP2 ; Set ARP pointer to point to XAR2
MOVL ACC,*++ ; Load ACC with location pointed to by XAR2,
; post−increment XAR2
NOP *,ARP3 ; Set ARP pointer to point to XAR3
MOVL *++,ACC ; Store ACC into location pointed to by XAR3,
; post−increment XAR3
NOP *,ARP0 ; Set ARP pointer to point to XAR0
XBANZ Loop,*−− ; Loop until AR0 == 0, post−decrement AR0
AMODE ”loc16/loc32” Syntax Description
X *++,ARPn 32bitDataAddr(31:0) = XAR(ARP)
if(loc16), XAR(ARP) = XAR(ARP) + 1
if(loc32), XAR(ARP) = XAR(ARP) + 2
Example(s):
MOVL XAR2,#Array1 ; Load XAR2 with start address of Array1
MOVL XAR3,#Array2 ; Load XAR3 with start address of Array2
MOV @AR0,#N−1 ; Load AR0 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,*++,ARP3 ; Load ACC with location pointed to by XAR2,
; post−increment XAR2, set ARP to point to XAR3
MOVL *++,ACC,ARP0 ; Store ACC into location pointed to by XAR3,
; post−increment XAR3, set ARP to point to XAR0
XBANZ Loop,*−−,ARP2 ; Loop until AR0 == 0, post−decrement AR0,
; set ARP pointer to point to XAR2