home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
OS2
/
EMXFIX04.ZIP
/
FIXUXFDI.S
< prev
next >
Wrap
Text File
|
1993-12-21
|
1KB
|
50 lines
/ fixuxfdi.s (emx+gcc) -- Copyright (c) 1993 by Eberhard Mattes
.globl ___fixunsxfdi
.text
.align 2, 0x90
/ ldexp (1.0, 63)
LC1: .long 0x00000000
.long 0x43e00000
.align 2, 0x90
#define tmp_lo -12(%ebp)
#define tmp_hi -8(%ebp)
#define cw1 -4(%ebp)
#define cw2 -2(%ebp)
/define saved_ebp 0(%ebp)
/define ret_addr 4(%ebp)
#define x 8(%ebp)
___fixunsxfdi:
pushl %ebp
movl %esp, %ebp
subl $12, %esp
fstcw cw1
movw cw1, %ax
orw $0x0c00, %ax / truncate towards zero
movw %ax, cw2
fldcw cw2
fldt x
fcoml LC1
fstsww %ax
sahf
jb 1f
fsubl LC1
fistpq tmp_lo
addl $0x80000000, tmp_hi
jmp 2f
.align 2, 0x90
1: fistpq tmp_lo
2: movl tmp_lo, %eax
movl tmp_hi, %edx
fldcw cw1
leave
ret