home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / GCC / FIXDFSI.S < prev    next >
Encoding:
Text File  |  1993-01-02  |  703 b   |  31 lines

  1. / fixdfsi.s (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes
  2.  
  3.         .globl  ___fixdfsi
  4.  
  5.         .text
  6.  
  7.         .align  2, 0x90
  8.  
  9. #define tmp           -8(%ebp)
  10. #define cw1           -4(%ebp)
  11. #define cw2           -2(%ebp)
  12. /define saved_ebp      0(%ebp)
  13. /define ret_addr       4(%ebp)
  14. #define x              8(%ebp)
  15.  
  16. ___fixdfsi:
  17.         pushl   %ebp
  18.         movl    %esp, %ebp
  19.         subl    $8, %esp
  20.         fstcw   cw1
  21.         movw    cw1, %ax
  22.         orw     $0x0c00, %ax            / truncate towards zero
  23.         movw    %ax, cw2
  24.         fldcw   cw2
  25.         fldl    x
  26.         fistpl  tmp
  27.         fldcw   cw1
  28.         movl    tmp, %eax
  29.         leave
  30.         ret
  31.