Texas Instruments TMS320C2XX User Manual

Page 174

Advertising
background image

Absolute Value of Accumulator

ABS

7-21

Assembly Language Instructions

Syntax

ABS

Operands

None

Opcode

0

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

0

0

0

0

0

0

0

0

0

1

1

1

1

1

0

1

Execution

Increment PC, then ...
|(ACC)|

ACC; 0

C

Status Bits

Affected by

Affects

OVM

C and OV

This instruction is not affected by SXM

Description

If the contents of the accumulator are greater than or equal to zero, the accu-
mulator is unchanged by the execution of ABS. If the contents of the accumula-
tor are less than zero, the accumulator is replaced by its 2s-complement value.
The carry bit (C) on the ’C2xx is always reset to zero by the execution of this
instruction.

Note that 8000 0000h is a special case. When the overflow mode is not set
(OVM = 0), the ABS of 8000 0000h is 8000 0000h. When the overflow mode
is set (OVM = 1), the ABS of 8000 0000h is 7FFF FFFFh. In either case, the
OV status bit is set.

Words

1

Cycles for a Single ABS Instruction

ROM

DARAM

SARAM

External

1

1

1

1+p

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

ROM

DARAM

SARAM

External

n

n

n

n+p

Cycles

Advertising