Texas Instruments TMS320C28x Reference Manual page 401

Dsp cpu and instruction set
Table of Contents

Advertisement

NEG ACC
NEG ACC
SYNTAX OPTIONS
NEG ACC
Operands
ACC
Description
Flags and
N
Modes
Z
C
V
OVM
Repeat
Example
; Negate contents of VarA, make sure value is saturated:
MOVL
SETC
NEG
MOVL
6-244
1111 1111 0101 0100
Accumulator register
Negate the contents of the ACC register:
if(ACC = 0x8000 0000)
{
V = 1;
if(OVM = 1)
ACC = 0x7FFF FFFF;
else
ACC = 0x8000 0000;
}
else
ACC = −ACC;
if(ACC = 0x0000 0000)
C = 1;
else
C = 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.
If (ACC = 0), set C; otherwise, clear C.
If (ACC = 0x8000 0000) at the start of the operation, this is considered an
overflow value and V is set. Otherwise, V is not affected.
If (ACC = 0x8000 0000) at the start of the operation, this is considered an
overflow value, and the ACC value after the operation depends on the state
of OVM: If OVM is cleared, ACC will be filled with 0x8000 0000. If OVM is set
ACC will be saturated to 0x7FFF FFFF.
This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
ACC,@VarA
OVM
ACC
@VarA,ACC
OPCODE
OBJMODE
; Load ACC with contents of VarA
; Turn overflow mode on
; Negate ACC and saturate
; Store result into VarA
Negate Accumulator
RPT
CYC
X
1

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