home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
201
/
DJGPP3.ZIP
/
EMU387
/
EMUSUBS.S
< prev
next >
Wrap
Text File
|
1991-04-25
|
2KB
|
100 lines
/*
** EMU-387 Math Routines
*/
#define P1 8(%ebp)
#define P2 12(%ebp)
#define P3 16(%ebp)
#define SIGN(x) (x)
#define TAG(x) 1(x)
#define EXP(x) 2(x)
#define SIG(x) 4(x)
#define SIGL(x) 4(x)
#define SIGH(x) 8(x)
/*
** void r_mov(reg& s, reg& d);
*/
.globl _r_mov__FR3regT0
_r_mov__FR3regT0:
movl 4(%esp),%ecx
movl 8(%esp),%edx
movl (%ecx),%eax
movl %eax,(%edx)
movl 4(%ecx),%eax
movl %eax,4(%edx)
movl 8(%ecx),%eax
movl %eax,8(%edx)
ret
/*
** int val_same(reg& s, reg& d)
*/
.globl _val_same__FR3regT0
_val_same__FR3regT0:
enter $0,$0
movl P1,%ecx
movl P2,%edx
movb SIGN(%ecx),%al
cmpb SIGN(%edx),%al
jne Lval_0
movw EXP(%ecx),%ax
cmpw EXP(%edx),%ax
jne Lval_0
movl SIG(%ecx),%eax
cmpl SIG(%edx),%eax
jne Lval_0
mov $1,%eax
jmp Lval_ret
Lval_0:
mov $0,%eax
Lval_ret:
leave
ret
/*
** int mag_same(reg& s, reg& d)
*/
.globl _mag_same__FR3regT0
_mag_same__FR3regT0:
enter $0,$0
movl P1,%ecx
movl P2,%edx
movw EXP(%ecx),%ax
cmpw EXP(%edx),%ax
jne Lmag_0
movl SIG(%ecx),%eax
cmpl SIG(%edx),%eax
jne Lmag_0
mov $1,%eax
jmp Lmag_ret
Lmag_0:
mov $0,%eax
Lmag_ret:
leave
ret
.globl _shld
_shld:
movl 4(%esp),%eax
movl (%eax),%ecx // lsl
movl 4(%eax),%edx // msl
shld $1,%ecx,%edx
shl $1,%ecx
movl %ecx,0(%eax)
movl %edx,4(%eax)
ret
.globl _shrd
_shrd:
movl 4(%esp),%eax
movl (%eax),%ecx // lsl
movl 4(%eax),%edx // msl
shrd $1,%edx,%ecx
shr $1,%edx
movl %ecx,0(%eax)
movl %edx,4(%eax)
ret