Motorola DSP96002 User Manual page 684

32-bit digital signal processor
Table of Contents

Advertisement

tst
dec
_tmov
move
move
move
jmp
;
; Both Addends are Zero
;
_bzero
move
move
eor
jclr
bclr
jclr
jset
bset
jmp
;
;
;
; ******************************************
; *** DP Addition for Normalized Numbers ***
; ******************************************
;
;
; Compare Exponents
;
_nadd
cmp
jgt
jeq
;
; *** Case: Exp0 > Exp1 ***
;
;
; Align Mantissas
;
sub
move
cmp
jgt
do
lsr
ror
jclr
move
_cclr1
nop
;
; Calculate Sticky Bit
;
_end1
move
and
jclr
bset
MOTOROLA
d3
; test mantr.high, get expr
d5
ifpl.u
; decrement expr if no int bit
d5.l,d1.h
; move result to d1
d0.m,d1.m
;
d0.l,d1.l
;
_done
; a0 is the answer
d0.h,d4.l
; get exp0
d1.h,d5.l
; get exp1
d4,d5
; check for opposite signs
#31,d5.l,_done
; jump if same signs
#31,d1.h
; set result as positive
#22,sr,_done
; jump if round bit r1 = zero
#21,sr,_done
; jump if round bit r0 = one
#31,d1.h
; set result as negative
_done
; result is negative zero
d4,d5
d1.h,d6.l
_pos
_add
d5,d4
d0.h,d6.l
#55,d7.l
d7,d4
; check for shift > 55
_setst0
; jump if shift > 55
d4.l,_end1
; align mantissas
d3
; shift right m1.h
d1
; shift right m1.l and GRS1
#8,d1.l,_cclr1
; jump if sticky bit clear
#1,d2.m
; set sticky bit
;
#grmsk,d7.l
; get GR mask
d7,d1
#0,d2.m,_add
; jump if sticky = 0
#8,d1.l
; put in sticky bit
DSP96002 USER'S MANUAL
"
"
; compare exps, get expr
; jump if exp1 > exp0
; jump if exp0 = exp1
; get shift, get expr
; get number of bits
; remove bits right of round bit
B-165

Advertisement

Table of Contents
loading

Table of Contents