kolibrios-gitea/programs/develop/ktcc/trunk/libc/math/ceil.asm
Magomed Kostoev (mkostoevr) 71b99beec5 Make libck project self-containing.
git-svn-id: svn://kolibrios.org@7855 a494cfbc-eb01-0410-851d-a64ba20cac60
2020-05-03 08:09:36 +00:00

31 lines
282 B
NASM

format ELF
include '../proc32.inc'
section '.text' executable
public ceil
ceil:
push ebp
mov ebp,esp
sub esp,8
fstcw [ebp-12]
mov dx,[ebp-12]
or dx,0x0800
and dx,0xfbff
mov word[ebp-16],dx
fldcw [ebp-16]
fld qword[ebp+8]
frndint
fldcw [ebp-12]
leave
ret