home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / assemblr / library / bluebook / asm-subr / dfp2sfp < prev    next >
Encoding:
Text File  |  1985-12-28  |  1.8 KB  |  50 lines

  1. ;-------------------------dfp2sfp routine begins--------------------------+
  2. ; ROUTINE FOR CONVERSION FROM DOUBLE PRECISION TO SINGLE PRECISION
  3. ;
  4. ; from BLUEBOOK OF ASSEMBLY ROUTINES FOR IBM PC & XT.
  5. ;         page : 113
  6. ;
  7. ; NAME DFP2SFP
  8. ;
  9. ; FUNCTION: This routine converts from double precision binary floating point
  10. ; to internal double precision floating point.
  11. ;
  12. ; INPUT: Upon entry a internal double precision binary floating point
  13. ; number is stored in DFPBUFF.  The internal double precision floating point
  14. ; number has a 40-bit binary mantissa, a sign bit,and an 8-bit exponent
  15. ; biased by 128 (See fig 5-8).
  16. ; OUTPUT: Upon exit a number is stored in single precision binary floating
  17. ; point form in SFPBUFF. The single precision binary floating point number
  18. ; has a 24-bit binary mantissa, a sign bit, and an 8-bit exponent biased by
  19. ; 128 (See fig 5-3).
  20. ;
  21. ; REGISTERS USED:  No registers are modified.
  22. ;
  23. ; SEGMENTS REFERENCED:  Upon entry the data segment must contain the
  24. ; storage for the variables SFPBUFF and DFPBUFF.
  25. ;
  26. ; ROUTINES CALLED:  None
  27. ;
  28. ; SPECIAL NOTES: Equates are used to shorten address fields.
  29. ;
  30. ; ROUTINE TO CONVERT FROM INTERNAL DOUBLE PRECISION FLOATING POINT TO
  31. ; INTERNAL SINGLE PRECISION FLOATING POINT
  32. ;
  33. dfp2sfp proc    far
  34. ;
  35.     push    ax        ; save registers
  36. ;
  37.     mov    ax,dfpbuffw4    ; get word from double precision 
  38.     mov    sfpbuffw0,ax    ; put in single precision
  39. ;
  40.     mov    ax,dfpbuffw6    ; get word from double precision 
  41.     mov    sfpbuffw2,ax    ; put in single precision
  42. ;
  43.     pop    ax        ; restore registers
  44.     ret            ; return
  45. ;
  46. dfp2sfp    endp
  47. ;-------------------------dfp2sfp routine ends---------------------------+
  48.  
  49.