EasyManuals Logo

Texas Instruments TMS320C28x User Manual

Texas Instruments TMS320C28x
695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #401 background imageLoading...
Page #401 background image
NEG ACC
6-244
NEG ACC Negate Accumulator
SYNTAX OPTIONS OPCODE OBJMODE RPT CYC
NEG ACC 1111 1111 0101 0100 X 1
Operands ACC Accumulator register
Description 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;
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 If (ACC = 0), set C; otherwise, clear C.
V 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.
OVM 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.
Repeat This instruction is not repeatable. If this instruction follows the RPT
instruction, it resets the repeat counter (RPTC) and executes only once.
Example
; Negate contents of VarA, make sure value is saturated:
MOVL ACC,@VarA ; Load ACC with contents of VarA
SETC OVM ; Turn overflow mode on
NEG ACC ; Negate ACC and saturate
MOVL @VarA,ACC ; Store result into VarA

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments TMS320C28x and is the answer not in the manual?

Texas Instruments TMS320C28x Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320C28x
CategoryProcessor
LanguageEnglish

Related product manuals