Circular Buffer With Amode - Texas Instruments TMS320C28x Reference Manual

Dsp cpu and instruction set
Table of Contents

Advertisement

Indirect Addressing Modes
Figure 5−2. Circular Buffer with AMODE = 1
Top of buffer
Bottom of buffer
Example(s):
; Calculate FIR filter (X[N] = data array, C[N] = coefficientv array):
MOVW
DP,#Xindex
MOVL
XAR6,#X
MOV
@AH,#N
MOV
AL,@Xindex
MOVL
XAR1,@ACC
MOVL
XAR7,#C
SPM
−4
ZAPA
RPT
#N−1
||QMACL P,*+XAR6[AR1%++],*XAR7++
ADDL
ACC,P << PM
MOV
@Xindex,AR1
MOVL
@Sum,ACC
5-24
31
XAR1
0
0
0
9
Buffer size =
9 + 1 = 10
31
XAR6
003F8010
XAR6 + XAR1[15:0] = 3F8010h
0x0000
XAR1[15:0] increments until
it matches XAR1[31:16]
XAR6 + XAR1[15:0] = 3F8010h + 0009h
Matches
XAR1[31:16]
; Load DP with page address of Xindex
; Load XAR6 with start address of X array
; Load AH with size of array X (N)
; Load AL with current circular index
; Load parameters into XAR1
; Load XAR7 with start address of C array
; 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 AR1 into current X index
; Store result into sum
16 15
0
0
0
0
0
Buffer index
0

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