beautypg.com

Motorola DSP96002 User Manual

Page 691

background image

B-172

DSP96002 USER’S MANUAL

MOTOROLA

; tmp1 = register name of the form "Dn", and is a temporary var which

; uses the lowest 32 bits of the register (Dn.L is destroyed)

; tmp2 = register name of the form "Dn", and is a temporary var which

; uses the lowest 32 bits of the register (Dn.L is destroyed)

;

; Note that op, tmp1, and tmp2 must all be different registers.

andi #$c3,ccr ;

jclr #31,op.h,_chkrst ;

ori #$8,ccr ;

_chkrst move op.h,tmp1.l ;

move #EXP_MSK,tmp2.l ;

and tmp2,tmp1 ;

tst op ;

jneq _chknan ;

tst tmp1 op.m,tmp2.l ;

jneq _maxexp ;

tst tmp2 ;

jneq _chknan ;

ori #$4,ccr ;

jmp _done ;

_maxexp move #MAX,tmp2.l ;

cmp tmp1,tmp2 op.m,tmp1.l ;

jne _done ;

bclr #31,tmp1.l ;

tst tmp1 ;

jneq _nan ;

andi #$b,ccr ;

ori #$10,ccr ;

jmp _done ;

_chknan move #MAX,tmp2.l ;

cmp tmp1,tmp2 ;

jne _done ;

_nan andi #$b,ccr ;

ori #$20,ccr ;

jset #30,op.m,_done ;

ori #$20,er ;

_done

endm

; ****** Reset Processor Flags ******

movec sr,d0.l ;

move #SR_MASK,d1.l ;

and d1,d0 ;

movec d0.l,sr ;