Texas Instruments TMS320C2XX User Manual

Page 275

Advertising
background image

NEG

Negate Accumulator

7-122

Syntax

NEG

Operands

None

Opcode

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

0

1

0

0

0

0

0

0

0

1

1

1

1

1

0

1

Execution

Increment PC, then ...
(ACC)

×

–1

ACC

Status Bits

Affected by

Affects

OVM

C and OV

Description

The content of the accumulator is replaced with its arithmetic complement (2s
complement). The OV bit is set when taking the NEG of 8000 0000h. If OVM
= 1, the accumulator content is replaced with 7FFF FFFFh. If OVM = 0, the
result is 8000 0000h. The carry bit (C) is cleared to 0 by this instruction for all
nonzero values of the accumulator, and is set to 1 if the accumulator equals
zero.

Words

1

Cycles for a Single NEG Instruction

ROM

DARAM

SARAM

External

1

1

1

1+p

Cycles for a Repeat (RPT) Execution of an NEG Instruction

ROM

DARAM

SARAM

External

n

n

n

n+p

Example 1

NEG

;(OVM = X) Convert –3544 to +3544

Before Instruction

After Instruction

ACC

X

0FFFFF228h

ACC

0

0DD8h

C

C

X

X

OV

OV

Example 2

NEG

;(OVM = 0)

Before Instruction

After Instruction

ACC

X

080000000h

ACC

0

080000000h

C

C

X

1

OV

OV

Cycles

Advertising