home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware 1 2 the Maxx
/
sw_1.zip
/
sw_1
/
PROGRAM
/
DJEMU106.ZIP
/
EMU387
/
E63.CC
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-25
|
1KB
|
82 lines
#include "emu.h"
#include "rmov.h"
#include "compare.h"
void emu_63()
{
if (empty())
return;
if (modrm > 0277)
{
// fcompp
if ((modrm&7) != 1)
return emu_bad();
if (empty(1))
{
setcc(SW_C3|SW_C2|SW_C0);
return;
}
int c = compare(st(), st(1));
int f;
st().tag = TW_E;
top++;
st().tag = TW_E;
top++;
if (c & COMP_NAN)
{
exception(EX_I);
f = SW_C3 | SW_C2 | SW_C0;
}
else
switch (c)
{
case COMP_A_LT_B:
f = SW_C0;
break;
case COMP_A_EQ_B:
f = SW_C3;
break;
case COMP_A_GT_B:
f = 0;
break;
case COMP_NOCOMP:
f = SW_C3 | SW_C2 | SW_C0;
break;
}
setcc(f);
}
else
{
// ficomp m16int
reg t;
r_mov((short *)get_modrm(), t);
int c = compare(st(), t);
st().tag = TW_E;
top++;
int f;
if (c & COMP_NAN)
{
exception(EX_I);
f = SW_C3 | SW_C2 | SW_C0;
}
else
switch (c)
{
case COMP_A_LT_B:
f = SW_C0;
break;
case COMP_A_EQ_B:
f = SW_C3;
break;
case COMP_A_GT_B:
f = 0;
break;
case COMP_NOCOMP:
f = SW_C3 | SW_C2 | SW_C0;
break;
}
setcc(f);
}
}