Texas Instruments TMS320C28x Reference Manual page 245

Dsp cpu and instruction set
Table of Contents

Advertisement

DMAC ACC:P,loc32,*XAR7/++
Example
;
Calculate sum of product using dual 16-bit multiply:
;
int16 X[N]
;
int16 C[N]
;
;
;
sum = 0;
;
for(i=0; i < N; i++)
;
sum = sum + (X[i] * C[i]) >> 5;
MOVL
MOVL
SPM
ZAPA
RPT
||DMAC
ADDL
MOVL
6-88
; Data information
; Coefficient information (located in low 4M)
; Data and Coeff must be aligned to even address
; N must be an even number
XAR2,#X
XAR7,#C
−5
#(N/2)−1
P,*XAR2++,*XAR7++
ACC,@P
@sum,ACC
; XAR2 = pointer to X
; XAR7 = pointer to C
; Set product shift to ">> 5"
; Zero ACC, P, OVC
; Repeat next instruction N/2 times
; ACC = ACC + (X[i+1] * C[i+1]) >> 5
; P = P + (X[i] * C[i]) >> 5 i++
; Perform final accumulate
; Store final result into sum

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