beautypg.com

Motorola DSP96002 User Manual

Page 700

background image

MOTOROLA

DSP96002 USER’S MANUAL

B-181

depftst d7,d0,d1 ;

jset #5,sr,_snan2 ;

jmp _done ;

_snan2 jset #13,sr,_op2sn ;

jmp _done ;

_op2sn ftfr.x d7,d6 ;

_op1sn bset #30,d6.m ;

ftfr.x d6,d5 ;

bset #4,sr ;

bset #13,sr ;

bset #20,sr ;

_done nop ;

nop

nop

rts ; end of subroutine

endsec

B.5

NON-IEEE DOUBLE PRECISION USING SOFTWARE EMULATION

dplib ident 1,0

;

; MOTOROLA DSP96002 DPLIB - VERSION 1.0
;
; EXTENDED DOUBLE PRECISION floating-point SUBROUTINE LIBRARY

;

page 132,60,1,1

;

; equates

;

exp equ 0 ;offset to exponent

sign equ 1 ;offset to sign

ms equ 2 ;offset to most significant word

ls equ 3 ;offset to least significand word

bias equ $1fffffff ;exponent bias

dptemp equ $1fc ;temporary storage in top 4 internal

;x memory locations

page

org x:dptemp ;double precision register

ds 1 ;exponent

ds 1 ;sign: 0=+, 1=-

ds 2 ;64 bit significand

;

page

org p:

;

; MOTOROLA DSP96002 DPLIB - VERSION 1.0
;
; IEEE2DPLIB - Convert floating-point number in d0 to an internal