SQRA loc16
Example
; Calculate sum of squares using 16-bit multiply:
; int16 X[N]
; sum = 0;
; for(i=0; i < N; i++)
;
MOVL
SPM
ZAPA
RPT
||SQRA
ADDL
MOVL
6-330
; Data information
sum = sum + (X[i] * X[i]) >> 5;
XAR2,#X
−5
#N−1
*XAR2++
ACC,P << PM
@sum,ACC
; XAR2 = pointer to X
; Set product shift to ">> 5"
; Zero ACC, P, OVC
; Repeat next instruction N times
; ACC = ACC + P >> 5,
; P = (*XAR2++)^2
; Perform final accumulate
; Store final result into sum
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?