Motorola DSP96002 User Manual page 712

32-bit digital signal processor
Table of Contents

Advertisement

eor
move
jmp
page
;
; Check for overflow and underflow and saturate or flush to zero
;
echeck
move
jset
jset
rts
oflow
move
move
move
move
move
rts
uflow
clr
move
move
move
move
rts
page
;
; MOTOROLA DSP96002 DPLIB - VERSION 1.0
;
; DP_NEG - Negate the double precision number pointed to by r0.
;
; Entry point:
;
; Inputs:
r0 contains the lowest address of a 4-word internal
;
;
; Outputs:
r0 contains the lowest address of a 4-word internal
;
;
; Alters:
D0.L,D1.L
;
dp_neg
move
move
or
jeq
move
neg
inc
move
negzero
rts
;
; MOTOROLA DSP96002 DPLIB - VERSION 1.0
;
; DP_SCALE:
;
MOTOROLA
d7,d1
d6.l,x:(r0)
d1.l,x:(r0+sign)
echeck
x:(r0),d0.l
#31,d0.l,uflow
#30,d0.l,oflow
#$3fffffff,d0.l
d0.l,x:(r0)
#$ffffffff,d0.l
d0.l,x:(r0+ms)
d0.l,x:(r0+ls)
d0
d0.l,x:(r0)
d0.l,x:(r0+sign)
d0.l,x:(r0+ms)
d0.l,x:(r0+ls)
dp_neg:
c(r0) = -c(r0)
extended precision number
extended precision number
x:(r0+ms),d0.l
x:(r0+ls),d1.l
d1,d0
negzero
x:(r0+sign),d0.l ;get sign
d0
d0
d0.l,x:(r0+sign) ;save sign
scale the double precision number
DSP96002 USER'S MANUAL
;new sign, save exp
;save sign
;go check for errors
;get exponent
;bit 31 indicates underflow
;bit 30 indicates overflow
;no errors
;max exponent
;max significand
;min exponent and significand
;get mantissa ms
;get mantissa ls
;check to see if zero
;can't have negative zero
;negate
;correct
;and return
B-193

Advertisement

Table of Contents
loading

Table of Contents