Motorola DSP96002 User Manual page 708

32-bit digital signal processor
Table of Contents

Advertisement

move
rts
page
;
; MOTOROLA DSP96002 DPLIB - VERSION 1.0
;
; DP_DIV - Divide two double precision numbers.
;
; Entry point:
;
; Inputs:
r0 contains the lowest address of a 4-word internal
;
;
r1 contains the lowest address of a 4-word internal
;
;
; Outputs:
r0 contains the lowest address of a 4-word internal
;
;
; NOTE:
Error checking:
;
;
;
; Alters:
D0.L,D1.L,D4.L,D5.L,D6.L,D7.L
;
dp_div
move
tst
jne
tst
jne
move
move
eor
move
tst
jne
tst
jne
jmp
_notdiv0 move
move
sub
add
move
move
move
move
cmp
jhi
jlo
cmp
jhs
_adj
lsr
ror
MOTOROLA
d0.l,x:(r0+sign)
dp_div:
c(r0)
extended precision number
extended precision number
extended precision number
0/0 returns 0
finite/0 returns saturated value
x:(r1),d0.l
d0
x:(r1),d1.l ;test, get ms
_notdiv0
d1
_notdiv0
x:(r0+sign),d0.l
x:(r1+sign),d1.l
d0,d1
x:(r0),d0.l ;new sign, get dividend exp
d1.l,x:(r0+sign)
d0
x:(r0+ms),d1.l
oflow
d1
oflow
uflow
x:(r0),d1.l
x:(r1),d0.l
d0,d1
#bias,d0.l
d0,d1
x:(r0+ms),d7.l
x:(r0+ls),d6.l
x:(r1+ms),d5.l
x:(r1+ls),d4.l
d5,d7
_startdiv
_adj
d4,d6
_startdiv
d5
d4
DSP96002 USER'S MANUAL
;apply to destination
c(r0)/c(r1)
;get divisor exponent
;non-zero
;test
;get sign
;get sign
;save new sign
;test, get ms
;finite/0 => overflow
;test
;finite/0 => overflow
;0/0 => zero
;get exponent a
;get exponent x
;new exponent, get bias
;Add bias back
;a ms
;a ls
;x ms
;x ls
;compare magnitudes
;dividend>divisor
;adjust if <
;extend comparison
;dividend >= divisor
;scale down divisor
B-189

Advertisement

Table of Contents
loading

Table of Contents