INSTRUCTION DESCRIPTIONS

ABS

Absolute Value

Operation:

Assembler Syntax:

ABS

D D (parallel move)

ABS D (parallel move)

Description: Take the absolute value of the destination operand D and store the result in the destination accumulator.

Example:

 

:

 

ABS A1 #$123456,X0 A,Y0

;take abs. value, set up X0, save value

:

 

A

Before Execution

$FF:FFFFFF:FFFFF2

A

After Execution

$00:000000:00000E

Explanation of Example: Prior to execution, the 56-bit A accumulator contains the value $FF:FFFFFF:FFFFF2. Since this is a negative number, the execution of the ABS instruction takes the twos complement of that value and returns $00:000000:00000E.

Note: For the case in which the D operand equals $80:000000:000000 (-256.0), the ABS instruction will cause an overflow to occur since the result cannot be correctly ex- pressed using the standard 56-bit, fixed-point, twos-complement data representation. Data limiting does not occur (i.e., A is not set to the limiting value of $7F:FFFFFF:FFFFFF).

Condition Codes:

15

14

 

13

12

11

10

9

8

7

6

 

5

4

3

2

1

0

LF

DM

T

**

 

S1

S0

 

I1

I0

S

L

E

U

N

Z

 

V

C

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

MR

 

 

 

 

 

 

 

 

 

 

CCR

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

S — Computed according to the definition in A.5 CONDITION CODE COMPUTATION. L — Set if limiting (parallel move) or overflow has occurred in result

E — Set if the signed integer portion of A or B result is in use U — Set if A or B result is unnormalized

N — Set if bit 55 of A or B result is set Z— Set if A or B result equals zero

V — Set if overflow has occurred in A or B result

Note: The definitions of the E and U bits vary according to the scaling mode being used. Refer to Section A.5 for complete details.

A - 22

INSTRUCTION SET DETAILS

MOTOROLA

Page 291
Image 291
Motorola 24-Bit Digital Signal Processor, DSP56000 manual Absolute Value, Operation Assembler Syntax, Condition Codes