Motorola DSP96002 User Manual page 575

32-bit digital signal processor
Table of Contents

Advertisement

Unsigned 32 Bit Integer
eor
do
rol
rol
cmp
sub
dloop
rol
not
The final remainder is not produced. This program may calculate only the number of quotient bits required
and has variable execution time.
Unsigned 32 Bit Integer
Division of d0 = d0/d1, d0>=d1
cmp
eor
jlo
bfind
jmi
bfind
movei
move
sub
inc
sub
lsl
do
cmp
sub
rol
divloop_fast
not
lsl
lsr
jmp
B-56
Division of d0 = d0/d2
d1,d1
#32,dloop
d0
d1
d2,d1
d2,d1
ifcc
d0
d0
d1,d0
d0,d0
divdone
d0,d0
dive2big
d1,d2
#32,d3
d0,d2
d2
d2,d3
d2,d1
d2.l,divloop_fast
d1,d0
d1,d0
d0
d0
d2,d0
d2,d0
divdone
DSP96002 USER'S MANUAL
; clear d1
;32 quotient bits
;dividend bit out, q bit in
;put in temp
;check for q bit
;update if less
;last q bit
;complement q bits
d0.l,d2.m
iflo
; divisor > dividend
d3.l,d8.l
;dividend has
;32 significant bits
d0.h,d0.l
;find # of quotient bits
d2.h,d2.l
d2.m,d0.l
d2.l,d2.h
;compute loop iteration count
d3.l,d2.h
;align divisor
;perform test subtract
ifhs
;if no borrow, do subtract
;mult remx2, save quo. bit (borrow)
d8.l,d3.l
;flip inverted quotient
;clean off any remainder
;done
Program
ICycles
Words
2
3
1
1
1
1
1
1
1
1
1
1
1
1
---
---
Totals:
8
133
MOTOROLA

Advertisement

Table of Contents
loading

Table of Contents