beautypg.com

Motorola DSP96002 User Manual

Page 689

background image

B-170

DSP96002 USER’S MANUAL

MOTOROLA

;

; Round toward -infinity

;

_rminf jclr #31,d6.l,_lmove ; no rounding if positive

_addone move #$800,d7.l ; get increment number

add d7,d1 ; add one to lsb

jcc _acar ; jump if no carry

inc d3 ; increment mantr.high

_acar jcc _lmove ; jump if result normalized

lsr d3 ; shift right mantr.high

ror d1 ; shift right mantr.low

inc d6 ; increment expr

move #emsk,d7.l ; get exp mask

move d6.l,d5.l ; get expr

and d7,d5 ; delete tags

cmp d7,d5 ; check for max exp

jne _lmove ; jump if no overflow

move #0,d1.l ; set result to infinity

move #0,d1.m ; "

ori #$10,ccr ; set infinity bit

ori #$09,ier ; set OVF and INX bits in IER

ori #$09,er ; set OVF and INX bits in ER

jmp _emove ; get infinity exponent

;

; Get Result in D1

;

_lmove move d3.l,d1.m ; move mantr.high to d1

_emove move d6.l,d1.h ; move expr to d1

_done nop ;

nop ;

nop ;

rts ; end of subroutine

endsec

B.4.3

IEEE Double Precision Multiplication

;

;********************************************************************

;********************************************************************

; *** IEEE Double Extended Precision Multiply Operation

; ***

; *** The routine was implemented as a unsigned multiply routine.

; ***

; *** 64-bit input operand format (immediately before multiply):

; *** i.fff...fl

; ***

; *** 67-bit intermediate result format (immediately after post norm):

; *** i.fff...flgrs

; *** where

; *** i = integer bit