Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2.         .text
  3. #include<libc/asm.h>
  4. MK_C_SYM(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.