Motorola DSP96002 User Manual page 676

32-bit digital signal processor
Table of Contents

Advertisement

jmp
;
; Set Sticky Bit for Shift > 55 Bits
;
_setst0 move
move
jmp
;
; *** Case: Exp1 > Exp0 ***
;
;
; Align Mantissas
;
_pos
sub
move
cmp
jgt
do
lsr
ror
jclr
move
_cclr2
nop
;
; Calculate Sticky Bit
;
_end2
move
and
jclr
bset
jmp
;
; Set Sticky Bit for Shift > 55 Bits
;
_setst1 move
move
;
; Check the Signs of the Addends
;
_add
jset
jset
jmp
;
; *** Case: Addend 0 is Negative,
;
Addend 1 is Positive ***
;
_neg1
jset
sub
subc
jcc
bset
move
not
not
MOTOROLA
_add
;
#0,d3.l
; get number for addition
#inum,d1.l
;
_add
;
d4,d5
d1.h,d6.l
#55,d7.l
d7,d5
; check for shift > 55
_setst1
; jump if shift > 55
d5.l,_end2
; align mantissas
d2
; shift right m0.h
d0
; shift right m0.l and GRS0
#8,d0.l,_cclr2
; jump if sticky bit clear
#1,d2.m
; set sticky bit
;
#grmsk,d7.l
; get GR mask
d7,d0
; remove bits right of round bit
#0,d2.m,_add
; jump if sticky = 0
#8,d1.l
; put in sticky bit
_add
;
#0,d2.l
; get number for addition
#inum,d0.l
;
#31,d0.h,_neg1
; jump if a0 negative
#31,d1.h,_neg2
; jump if a1 negative
_fadd
; jump to addition for a0+,a1+
#31,d1.h,_nset
; jump if a1 negative
d0,d1
; subtract for case: a0-,a1+
d2,d3
;
_zchk
; jump if result is positive
#31,d6.l
; set result as negative
#inum,d7.l
; get increment number
d1
; get 2's comp of result
d3
;
DSP96002 USER'S MANUAL
"
; get shift, get expr
; get number of bits
"
"
"
B-157

Advertisement

Table of Contents
loading

Table of Contents