![background image](http://html1.mh-extra.com/html/texas-instruments/tms320c28x/tms320c28x_reference-manual_1097071470.webp)
SAT ACC
6-313
SAT ACC
Saturate Accumulator
SYNTAX OPTIONS
OPCODE
OBJMODE
RPT
CYC
SAT ACC
1111 1111 0101 0111
X
−
1
Operands
ACC
Accumulator register
Description
Saturate the ACC register to reflect the net overflow represented in the 6-bit
overflow counter (OVC):
if( OVC > 0 )
ACC = 0x7FFF FFFF;
V = 1;
if( OVC < 0 )
ACC = 0x8000 0000;
V = 1;
if( OVC = 0 )
ACC = unchanged;
OVC = 0;
Flags and
Modes
N
After the operation, the N flag is set if bit 31 of the ACC is 1, else N is cleared.
Z
After the operation, the Z flag is set if the ACC is zero, else Z is cleared.
C
C is cleared.
V
If (OVC != 0) at the start of the operation, V is set; otherwise, V is cleared
OVC
If (OVC > 0) then ACC is saturated to its maximum positive value.
If (OVC < 0) then ACC is saturated to its maximum negative value.
if (OVC = 0) then ACC is not modified.
After the operation, OVC is cleared.
Repeat
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Add VarA, VarB and VarC and saturate result and store in VarD:
ZAP OVC
; Clear overflow counter
MOVL ACC,@VarA
; Load ACC with contents of VarA
ADDL ACC,@VarB
; Add to ACC contents of VarB
ADDL ACC,@VarC
; Add to ACC contents of VarC
SAT ACC
; Saturate ACC based on OVC value
MOVL @VarD,ACC
; Store result into VarD
Summary of Contents for TMS320C28x
Page 30: ...1 12...
Page 80: ...This page intentionally left blank 2 50 This page intentionally left blank...
Page 269: ...IN loc16 PA 6 112 MOV AL 0 AL 0 UOUT IORegC AL IOspace IORegC AL 10...
Page 308: ...MAXCUL P loc32 6 151 Saturate MOVL Var64 2 ACC Store result into Var64 MOVL Var64 P...
Page 509: ...SUBL ACC P PM 6 352 SUBL ACC P PM ACC S B 11 M X 4 MOVH Y ACC 5 Store Q15 result into Y...
Page 585: ...This page intentionally left blank 7 32 This page intentionally left blank...