beautypg.com

Getexp extract exponent getexp – Motorola DSP96002 User Manual

Page 368

background image

A - 180

DSP96002 USER’S MANUAL

MOTOROLA

GETEXP

Extract Exponent

GETEXP

Operation:

Exponent(S)

D.L (parallel data bus move)

Assembler Syntax:

GETEXP S,D
(move syntax - see the Move instruction description.)

Description:

Extract the exponent of the single extended precision floating-point operand S and store it as an unbiased,

2’s complement, 32-bit integer in the low portion of D . The exponent value is decremented by the number

of shifts needed to normalize the mantissa if the floating-point number was denormalized.

As an example of the use of FGETMAN, GETEXP, and FSCALE; consider decomposing a floating-point

number into its mantissa and unbiased exponent and then recreating the original floating-point number.

FGETMAN

D0, D1

;extract normalized mantissa

GETEXP

D0,D2

;extract unbiased exponent

MOVE

D2.L, D2.H

;move unbiased exponent

FSCALE.S

D2.H, D1

;scale original mantissa

The following table lists the results for some special cases:

Source operand

Result

+/- infinity

$7FFFFFFF

+/- zero

$80000000

SNaN or QNaN

$FFFFFFFF

Input Operand(s) Precision: SEP Floating-Point.

Output Operand Precision: 32-bit integer.

CCR Condition Codes:

C

- Not affected.

V

- Not affected.

Z

- Set if result is zero. Cleared otherwise.

N

- Set if result is negative. Cleared otherwise.

I

- Set if the source operand is infinity. Cleared otherwise.

LR

- Not affected.

R

- Not affected.

A

- Not affected.