home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
359_11
/
patch5.000
/
EMU387
/
E54.CC
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-11
|
779b
|
48 lines
#include "emu.h"
#include "rmov.h"
#include "compare.h"
void emu_54()
{
if (empty())
return;
if (modrm > 0277)
{
// fucom st(i)
if (empty(modrm&7))
{
setcc(SW_C3|SW_C2|SW_C0);
return;
}
int c = compare(st(), st(modrm&7));
int f;
if (c & COMP_SNAN)
{
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
{
emu_bad();
}
}