Texas Instruments TMS320C28x Reference Manual page 470

Dsp cpu and instruction set
Table of Contents

Advertisement

SAT ACC
SYNTAX OPTIONS
SAT ACC
Operands
ACC
Description
Flags and
N
Modes
Z
C
V
OVC
Repeat
Example
; Add VarA, VarB and VarC and saturate result and store in VarD:
ZAP
MOVL
ADDL
ADDL
SAT
MOVL
1111 1111 0101 0111
Accumulator register
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;
After the operation, the N flag is set if bit 31 of the ACC is 1, else N is cleared.
After the operation, the Z flag is set if the ACC is zero, else Z is cleared.
C is cleared.
If (OVC != 0) at the start of the operation, V is set; otherwise, V is cleared
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.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
OVC
ACC,@VarA
ACC,@VarB
ACC,@VarC
ACC
@VarD,ACC
OPCODE
OBJMODE
; Clear overflow counter
; Load ACC with contents of VarA
; Add to ACC contents of VarB
; Add to ACC contents of VarC
; Saturate ACC based on OVC value
; Store result into VarD
SAT ACC
Saturate Accumulator
RPT
CYC
X
1
6-313

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