forked from KolibriOS/kolibrios
1f4d74f500
git-svn-id: svn://kolibrios.org@8622 a494cfbc-eb01-0410-851d-a64ba20cac60
34 lines
516 B
ArmAsm
34 lines
516 B
ArmAsm
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
|
.text
|
|
#include "libc/asm.h"
|
|
MK_C_SYM(modf)
|
|
pushl %ebp
|
|
movl %esp,%ebp
|
|
subl $16,%esp
|
|
pushl %ebx
|
|
fnstcw -4(%ebp)
|
|
fwait
|
|
movw -4(%ebp),%ax
|
|
orw $0x0c3f,%ax
|
|
movw %ax,-8(%ebp)
|
|
fldcw -8(%ebp)
|
|
fwait
|
|
fldl 8(%ebp)
|
|
frndint
|
|
fstpl -16(%ebp)
|
|
fwait
|
|
movl -16(%ebp),%edx
|
|
movl -12(%ebp),%ecx
|
|
movl 16(%ebp),%ebx
|
|
movl %edx,(%ebx)
|
|
movl %ecx,4(%ebx)
|
|
fldl 8(%ebp)
|
|
fsubl -16(%ebp)
|
|
leal -20(%ebp),%esp
|
|
fclex
|
|
fldcw -4(%ebp)
|
|
fwait
|
|
popl %ebx
|
|
leave
|
|
ret
|