ZAPA
ZAPA
SYNTAX OPTIONS
ZAPA
Operands
Description
Flags and
N
Modes
Z
Repeat
Example
; Calculate sum of product using 32-bit multiply and retain
;
; int32 X[N]; // Data information
; int32 C[N]; // Coefficient information (located in low 4M)
; int32 sum = 0;
; for(i=0; i < N; i++)
;
MOVL
MOVL
SPM
ZAPA
RPT
||QMACL
ADDL
MOVL
6-396
None
Zero the ACC and P registers as well as the overflow counter (OVC):
ACC = 0;
P = 0;
OVC = 0;
The N bit is set.
The Z bit is cleared.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
high result:
sum = sum + ((X[i] * C[i]) >> 32) >> 5;
XAR2,#X
XAR7,#C
−5
#(N−1)
P,*XAR2++,*XAR7++
ACC,P << PM
@sum,ACC
Zero Accumulator and P Register
OPCODE
0101 0110 0011 0011
; XAR2 = pointer to X
; XAR7 = pointer to C
; Set product shift to ">> 5"
; Zero ACC, P, OVC
; Repeat next instruction N times
; ACC = ACC + P >> 5,
; P = (X[i] * C[i]) >> 32
; i++
; Perform final accumulate
; Store final result into sum
OBJMODE
RPT
CYC
1
−
1
Need help?
Do you have a question about the TMS320C28x and is the answer not in the manual?