home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / math / modf.s < prev    next >
Encoding:
Text File  |  1994-12-10  |  533 b   |  34 lines

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2.     .text
  3.     .globl    _modf
  4. _modf:
  5.     pushl    %ebp
  6.     movl    %esp,%ebp
  7.     subl    $16,%esp
  8.     pushl    %ebx
  9.     fnstcw    -4(%ebp)
  10.     fwait
  11.     movw    -4(%ebp),%ax
  12.     orw    $0x0c3f,%ax
  13.     movw    %ax,-8(%ebp)
  14.     fldcw    -8(%ebp)
  15.     fwait
  16.     fldl    8(%ebp)
  17.     frndint
  18.     fstpl    -16(%ebp)
  19.     fwait
  20.     movl    -16(%ebp),%edx
  21.     movl    -12(%ebp),%ecx
  22.     movl    16(%ebp),%ebx
  23.     movl    %edx,(%ebx)
  24.     movl    %ecx,4(%ebx)
  25.     fldl    8(%ebp)
  26.     fsubl    -16(%ebp)
  27.     leal    -20(%ebp),%esp
  28.     fclex
  29.     fldcw    -4(%ebp)
  30.     fwait
  31.     popl    %ebx
  32.     leave
  33.     ret
  34.