beautypg.com

Motorola DSP96002 User Manual

Page 695

background image

B-176

DSP96002 USER’S MANUAL

MOTOROLA

; d5.l = next most significant word,

; d3.l = next most significant word,

; and least significant word info

; is in the sticky bit.

;

; Upper 96 bits = d4.l:d5.l:d3.l, and

; the lowest 32 bits have been ORed

; into the sticky bit.

; ****** Continue Calculating Sticky Bit ******

move #SMSK,d0.l ;

move d5.l,d2.l ;

and d0,d2 ;

tst d2 ;

jeq _stlow ;

move #1,d1.h ;

_stlow tst d3 ;

jeq _post ;

move #1,d1.h ;

; ****** Post Normalization ******

_post jset #31,d4.l,_undr ;

_ptop asl d3 ;

rol d5 ;

rol d4 d0.m,d0.l ;

move d0.m,d0.l ;

dec d0 ;

move d0.l,d0.m ;

jclr #31,d4.l,_ptop ;

; ****** Underflow Check ******

_undr

move d0.m,d0.l ;

move #EMIN,d1.l ;

sub d1,d0 ;

jpl _rnd ;

jset #27,sr,_ret0 ;

;

move #-52,d1.l ;

cmp d1,d0 ;

jmi _rnd0 ;