Category : Assembly Language Source Code
Archive   : ASM-SUBR.ZIP
Filename : SFP2DFP

 
Output of file : SFP2DFP contained in archive : ASM-SUBR.ZIP
;-------------------------sfp2dfp routine begins--------------------------+
; ROUTINE FOR CONVERSION FROM SINGLE PRECISION TO DOUBLE PRECISION
;
; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
; page : 111
;
; NAME SFP2DFP
;
; FUNCTION: This routine converts from single precision binary floating point
; to internal double precision floating point.
;
; INPUT: Upon entry a number is stored in single precision binary floating
; point form in SFPBUFF. The single precision binary floating point number
; has a 24-bit binary mantissa, a sign bit, and an 8-bit exponent biased by
; 128 (See fig 5-3).
;
; OUTPUT: Upon exit a internal double precision binary floating point
; number is stored in DFPBUFF. The internal double precision floating point
; number has a 40-bit binary mantissa, a sign bit,and an 8-bit exponent
; biased by 128 (See fig 5-8).
;
; REGISTERS USED: No registers are modified.
;
; SEGMENTS REFERENCED: Upon entry the data segment must contain the
; storage for the variables SFPBUFF and DFPBUFF.
;
; ROUTINES CALLED: None
;
; SPECIAL NOTES: Equates are used to shorten address fields.
;
; ROUTINE TO CONVERT FROM INTERNAL SINGLE PRECISION FLOATING POINT TO
; INTERNAL DOUBLE PRECISION FLOATING POINT
;
sfp2dfp proc far
;
push ax ; save registers
;
; clear lower part of mantissa
mov dfpbuffw0,0 ; clear low word
mov dfpbuffw2,0 ; clear next low word
;
; move rest of mantissa
mov ax,sfpbuffw0 ; get word from single precision
mov dfpbuffw4,ax ; put in double precision
;
mov ax,sfpbuffw2 ; get word from single precision (7 hi bits)
mov dfpbuffw6,ax ; put in double precision
;
pop ax ; restore registers
ret ; return
;
sfp2dfp endp
;-------------------------sfp2dfp routine ends---------------------------+



  3 Responses to “Category : Assembly Language Source Code
Archive   : ASM-SUBR.ZIP
Filename : SFP2DFP

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/