Indirect Addressing Modes
Figure 5−1. Circular Buffer with AMODE = 0
Example(s):
; Calculate FIR filter (X[N] = data array, C[N] = coefficient array):
MOVW
DP,#Xpointer
MOVL
XAR6,@Xpointer
MOVL
XAR7,#C
MOV
@AR1,#N
SPM
−4
ZAPA
RPT
#N−1
||QMACL P,*AR6%++,*XAR7++
ADDL
ACC,P << PM
MOVL
@Xpointer,XAR6
MOVL
@Sum,ACC
5-22
Top of buffer
Bottom of buffer
; Load DP with page address of Xpointer
; Load XAR6 with current X pointer
; Load XAR7 with start address of C array
; Load AR1 with size of data array N,
; Set product shift mode to ">> 4"
; Zero ACC, P, OVC
; Repeat next instruction N times
; ACC = ACC + P >> 4,
; P = (*AR6%++ * *XAR7++) >> 32
; Final accumulate
; Store XAR6 into current X pointer
; Store result into sum
15
AR1
X
X
31
XAR6
X X X X X X
XAR6[7:0] is incremented until it matches AR1[7:0]
31
XAR6
X
X
X
X
8 7
0
0
8
Buffer size = 8 + 1 = 9
8
7
0
0
0
Must be zero
8
7
0
X
X
0
8
Matches AR1[7:0]
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?