removed a few leftover DPRINT..s
This commit is contained in:
@@ -149,12 +149,9 @@ extern "C" { /* Use "C" linkage when in C++ mode */
|
|||||||
void X86EMU_exec(void);
|
void X86EMU_exec(void);
|
||||||
void X86EMU_halt_sys(void);
|
void X86EMU_halt_sys(void);
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DBG_X86EMU
|
||||||
#define HALT_SYS() \
|
#define HALT_SYS() \
|
||||||
DPRINT("halt_sys: file "); \
|
dbg("%s: halt_sys: file %s line %d\r\n", __FUNCTION__, __FILE__, __LINE__);\
|
||||||
DPRINT(__FILE__); \
|
|
||||||
DPRINTVAL(", line ", __LINE__); \
|
|
||||||
DPRINT("\r\n"); \
|
|
||||||
X86EMU_halt_sys();
|
X86EMU_halt_sys();
|
||||||
#else
|
#else
|
||||||
#define HALT_SYS() X86EMU_halt_sys()
|
#define HALT_SYS() X86EMU_halt_sys()
|
||||||
|
|||||||
@@ -65,12 +65,6 @@
|
|||||||
|
|
||||||
#include "radeonfb.h"
|
#include "radeonfb.h"
|
||||||
|
|
||||||
#ifdef DEBUG_X86EMU
|
|
||||||
#define DEBUG /* => see also sys.c */
|
|
||||||
#else
|
|
||||||
#undef DEBUG
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "x86emu.h"
|
#include "x86emu.h"
|
||||||
#include "x86regs.h"
|
#include "x86regs.h"
|
||||||
#include "x86decode.h"
|
#include "x86decode.h"
|
||||||
|
|||||||
@@ -80,12 +80,13 @@ struct x86_fpu_reg {
|
|||||||
|
|
||||||
#define X86_FPU_STKTOP 0
|
#define X86_FPU_STKTOP 0
|
||||||
|
|
||||||
struct x86_fpu_registers {
|
struct x86_fpu_registers
|
||||||
|
{
|
||||||
struct x86_fpu_reg x86_fpu_stack[8];
|
struct x86_fpu_reg x86_fpu_stack[8];
|
||||||
int x86_fpu_flags;
|
int x86_fpu_flags;
|
||||||
int x86_fpu_config; /* rounding modes, etc. */
|
int x86_fpu_config; /* rounding modes, etc. */
|
||||||
short x86_fpu_tos, x86_fpu_bos;
|
short x86_fpu_tos, x86_fpu_bos;
|
||||||
};
|
};
|
||||||
|
|
||||||
#pragma pack()
|
#pragma pack()
|
||||||
|
|
||||||
@@ -102,14 +103,14 @@ struct x86_fpu_registers {
|
|||||||
|
|
||||||
#endif /* X86_FPU_SUPPORT */
|
#endif /* X86_FPU_SUPPORT */
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DBG_X86EMU
|
||||||
# define DECODE_PRINTINSTR32(t,mod,rh,rl) \
|
#define DECODE_PRINTINSTR32(t, mod, rh, rl) \
|
||||||
DECODE_PRINTF(t[(mod<<3)+(rh)]);
|
DECODE_PRINTF(t[(mod << 3) + (rh)]);
|
||||||
# define DECODE_PRINTINSTR256(t,mod,rh,rl) \
|
#define DECODE_PRINTINSTR256(t, mod, rh, rl) \
|
||||||
DECODE_PRINTF(t[(mod<<6)+(rh<<3)+(rl)]);
|
DECODE_PRINTF(t[(mod << 6) + (rh << 3) + (rl)]);
|
||||||
#else
|
#else
|
||||||
# define DECODE_PRINTINSTR32(t,mod,rh,rl)
|
#define DECODE_PRINTINSTR32(t,mod,rh,rl)
|
||||||
# define DECODE_PRINTINSTR256(t,mod,rh,rl)
|
#define DECODE_PRINTINSTR256(t,mod,rh,rl)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* __X86EMU_FPU_REGS_H */
|
#endif /* __X86EMU_FPU_REGS_H */
|
||||||
|
|||||||
223
x86emu/x86fpu.c
223
x86emu/x86fpu.c
@@ -1,41 +1,41 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
*
|
*
|
||||||
* Realmode X86 Emulator Library
|
* Realmode X86 Emulator Library
|
||||||
*
|
*
|
||||||
* Copyright (C) 1991-2004 SciTech Software, Inc.
|
* Copyright (C) 1991-2004 SciTech Software, Inc.
|
||||||
* Copyright (C) David Mosberger-Tang
|
* Copyright (C) David Mosberger-Tang
|
||||||
* Copyright (C) 1999 Egbert Eich
|
* Copyright (C) 1999 Egbert Eich
|
||||||
*
|
*
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
*
|
*
|
||||||
* Permission to use, copy, modify, distribute, and sell this software and
|
* Permission to use, copy, modify, distribute, and sell this software and
|
||||||
* its documentation for any purpose is hereby granted without fee,
|
* its documentation for any purpose is hereby granted without fee,
|
||||||
* provided that the above copyright notice appear in all copies and that
|
* provided that the above copyright notice appear in all copies and that
|
||||||
* both that copyright notice and this permission notice appear in
|
* both that copyright notice and this permission notice appear in
|
||||||
* supporting documentation, and that the name of the authors not be used
|
* supporting documentation, and that the name of the authors not be used
|
||||||
* in advertising or publicity pertaining to distribution of the software
|
* in advertising or publicity pertaining to distribution of the software
|
||||||
* without specific, written prior permission. The authors makes no
|
* without specific, written prior permission. The authors makes no
|
||||||
* representations about the suitability of this software for any purpose.
|
* representations about the suitability of this software for any purpose.
|
||||||
* It is provided "as is" without express or implied warranty.
|
* It is provided "as is" without express or implied warranty.
|
||||||
*
|
*
|
||||||
* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
* THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
||||||
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
||||||
* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
* EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
||||||
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
|
||||||
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
* USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||||||
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
* OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||||
* PERFORMANCE OF THIS SOFTWARE.
|
* PERFORMANCE OF THIS SOFTWARE.
|
||||||
*
|
*
|
||||||
* ========================================================================
|
* ========================================================================
|
||||||
*
|
*
|
||||||
* Language: ANSI C
|
* Language: ANSI C
|
||||||
* Environment: Any
|
* Environment: Any
|
||||||
* Developer: Kendall Bennett
|
* Developer: Kendall Bennett
|
||||||
*
|
*
|
||||||
* Description: This file contains the code to implement the decoding and
|
* Description: This file contains the code to implement the decoding and
|
||||||
* emulation of the FPU instructions.
|
* emulation of the FPU instructions.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "x86debug.h"
|
#include "x86debug.h"
|
||||||
#include "x86emui.h"
|
#include "x86emui.h"
|
||||||
@@ -55,7 +55,8 @@ void x86emuOp_esc_coprocess_d8(uint8_t X86EMU_UNUSED(op1))
|
|||||||
|
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
|
|
||||||
static char *x86emu_fpu_op_d9_tab[] = {
|
static char *x86emu_fpu_op_d9_tab[] =
|
||||||
|
{
|
||||||
"FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
|
"FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
|
||||||
"FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
|
"FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
|
||||||
|
|
||||||
@@ -66,7 +67,8 @@ static char *x86emu_fpu_op_d9_tab[] = {
|
|||||||
"FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
|
"FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *x86emu_fpu_op_d9_tab1[] = {
|
static char *x86emu_fpu_op_d9_tab1[] =
|
||||||
|
{
|
||||||
"FLD\t", "FLD\t", "FLD\t", "FLD\t",
|
"FLD\t", "FLD\t", "FLD\t", "FLD\t",
|
||||||
"FLD\t", "FLD\t", "FLD\t", "FLD\t",
|
"FLD\t", "FLD\t", "FLD\t", "FLD\t",
|
||||||
|
|
||||||
@@ -104,13 +106,17 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
if (mod != 3) {
|
if (mod != 3)
|
||||||
|
{
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab, mod, rh, rl);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
|
DECODE_PRINTF(x86emu_fpu_op_d9_tab1[(rh << 3) + rl]);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
@@ -125,18 +131,23 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
case 3: /* register to register */
|
case 3: /* register to register */
|
||||||
stkelem = (uint8_t)rl;
|
stkelem = (uint8_t)rl;
|
||||||
if (rh < 4) {
|
if (rh < 4)
|
||||||
|
{
|
||||||
DECODE_PRINTF2("ST(%d)\r\n", stkelem);
|
DECODE_PRINTF2("ST(%d)\r\n", stkelem);
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
/* execute */
|
/* execute */
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
|
x86emu_fpu_R_fld(X86EMU_FPU_STKTOP, stkelem);
|
||||||
break;
|
break;
|
||||||
@@ -144,7 +155,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
|
x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP, stkelem);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
switch (rl) {
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_nop();
|
x86emu_fpu_R_nop();
|
||||||
break;
|
break;
|
||||||
@@ -156,7 +168,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
|
x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP, stkelem);
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
switch (rl) {
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
|
x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP);
|
||||||
break;
|
break;
|
||||||
@@ -177,7 +190,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
switch (rl) {
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
|
x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP);
|
||||||
break;
|
break;
|
||||||
@@ -207,7 +221,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 6:
|
case 6:
|
||||||
switch (rl) {
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
|
x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP);
|
||||||
break;
|
break;
|
||||||
@@ -236,7 +251,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:
|
case 7:
|
||||||
switch (rl) {
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
|
x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP);
|
||||||
break;
|
break;
|
||||||
@@ -264,7 +280,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
|
x86emu_fpu_M_fld(X86EMU_FPU_FLOAT, destoffset);
|
||||||
break;
|
break;
|
||||||
@@ -299,7 +316,8 @@ void x86emuOp_esc_coprocess_d9(uint8_t X86EMU_UNUSED(op1))
|
|||||||
|
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
|
|
||||||
char *x86emu_fpu_op_da_tab[] = {
|
char *x86emu_fpu_op_da_tab[] =
|
||||||
|
{
|
||||||
"FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
|
"FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
|
||||||
"FICOMP\tDWORD PTR ",
|
"FICOMP\tDWORD PTR ",
|
||||||
"FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
|
"FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
|
||||||
@@ -318,7 +336,6 @@ char *x86emu_fpu_op_da_tab[] = {
|
|||||||
"ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
|
"ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
|
||||||
"ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
|
"ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* DBG_X86EMU */
|
#endif /* DBG_X86EMU */
|
||||||
|
|
||||||
/* opcode=0xda */
|
/* opcode=0xda */
|
||||||
@@ -331,7 +348,8 @@ void x86emuOp_esc_coprocess_da(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab, mod, rh, rl);
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
@@ -350,12 +368,14 @@ void x86emuOp_esc_coprocess_da(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
x86emu_fpu_illegal();
|
x86emu_fpu_illegal();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
|
x86emu_fpu_M_iadd(X86EMU_FPU_SHORT, destoffset);
|
||||||
break;
|
break;
|
||||||
@@ -389,7 +409,8 @@ void x86emuOp_esc_coprocess_da(uint8_t X86EMU_UNUSED(op1))
|
|||||||
|
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
|
|
||||||
char *x86emu_fpu_op_db_tab[] = {
|
char *x86emu_fpu_op_db_tab[] =
|
||||||
|
{
|
||||||
"FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
|
"FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
|
||||||
"ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
|
"ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
|
||||||
|
|
||||||
@@ -411,10 +432,14 @@ void x86emuOp_esc_coprocess_db(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
if (mod != 3) {
|
if (mod != 3)
|
||||||
|
{
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab, mod, rh, rl);
|
||||||
} else if (rh == 4) { /* === 11 10 0 nnn */
|
}
|
||||||
switch (rl) {
|
else if (rh == 4)
|
||||||
|
{ /* === 11 10 0 nnn */
|
||||||
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
DECODE_PRINTF("FENI\r\n");
|
DECODE_PRINTF("FENI\r\n");
|
||||||
break;
|
break;
|
||||||
@@ -428,11 +453,14 @@ void x86emuOp_esc_coprocess_db(uint8_t X86EMU_UNUSED(op1))
|
|||||||
DECODE_PRINTF("FINIT\r\n");
|
DECODE_PRINTF("FINIT\r\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
DECODE_PRINTF2("ESC_DB %0x\r\n", (mod << 6) + (rh << 3) + (rl));
|
DECODE_PRINTF2("ESC_DB %0x\r\n", (mod << 6) + (rh << 3) + (rl));
|
||||||
}
|
}
|
||||||
#endif /* DBG_X86EMU */
|
#endif /* DBG_X86EMU */
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
break;
|
break;
|
||||||
@@ -447,11 +475,14 @@ void x86emuOp_esc_coprocess_db(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
/* execute */
|
/* execute */
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 4:
|
case 4:
|
||||||
switch (rl) {
|
switch (rl)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_feni();
|
x86emu_fpu_R_feni();
|
||||||
break;
|
break;
|
||||||
@@ -475,7 +506,8 @@ void x86emuOp_esc_coprocess_db(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
|
x86emu_fpu_M_fild(X86EMU_FPU_SHORT, destoffset);
|
||||||
break;
|
break;
|
||||||
@@ -508,7 +540,8 @@ void x86emuOp_esc_coprocess_db(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
char *x86emu_fpu_op_dc_tab[] = {
|
char *x86emu_fpu_op_dc_tab[] =
|
||||||
|
{
|
||||||
"FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
|
"FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
|
||||||
"FCOMP\tQWORD PTR ",
|
"FCOMP\tQWORD PTR ",
|
||||||
"FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
|
"FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
|
||||||
@@ -539,7 +572,8 @@ void x86emuOp_esc_coprocess_dc(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab, mod, rh, rl);
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
@@ -559,9 +593,11 @@ void x86emuOp_esc_coprocess_dc(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
/* execute */
|
/* execute */
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
|
x86emu_fpu_R_fadd(stkelem, X86EMU_FPU_STKTOP);
|
||||||
break;
|
break;
|
||||||
@@ -589,7 +625,8 @@ void x86emuOp_esc_coprocess_dc(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
|
x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE, destoffset);
|
||||||
break;
|
break;
|
||||||
@@ -623,7 +660,8 @@ void x86emuOp_esc_coprocess_dc(uint8_t X86EMU_UNUSED(op1))
|
|||||||
|
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
|
|
||||||
static char *x86emu_fpu_op_dd_tab[] = {
|
static char *x86emu_fpu_op_dd_tab[] =
|
||||||
|
{
|
||||||
"FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
|
"FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
|
||||||
"FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
|
"FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
|
||||||
|
|
||||||
@@ -649,7 +687,8 @@ void x86emuOp_esc_coprocess_dd(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab, mod, rh, rl);
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
@@ -668,9 +707,11 @@ void x86emuOp_esc_coprocess_dd(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_ffree(stkelem);
|
x86emu_fpu_R_ffree(stkelem);
|
||||||
break;
|
break;
|
||||||
@@ -689,7 +730,8 @@ void x86emuOp_esc_coprocess_dd(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
|
x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE, destoffset);
|
||||||
break;
|
break;
|
||||||
@@ -756,7 +798,8 @@ void x86emuOp_esc_coprocess_de(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab, mod, rh, rl);
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
@@ -775,9 +818,11 @@ void x86emuOp_esc_coprocess_de(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
|
x86emu_fpu_R_faddp(stkelem, X86EMU_FPU_STKTOP);
|
||||||
break;
|
break;
|
||||||
@@ -808,7 +853,8 @@ void x86emuOp_esc_coprocess_de(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
|
x86emu_fpu_M_fiadd(X86EMU_FPU_WORD, destoffset);
|
||||||
break;
|
break;
|
||||||
@@ -842,7 +888,8 @@ void x86emuOp_esc_coprocess_de(uint8_t X86EMU_UNUSED(op1))
|
|||||||
|
|
||||||
#ifdef DBG_X86EMU
|
#ifdef DBG_X86EMU
|
||||||
|
|
||||||
static char *x86emu_fpu_op_df_tab[] = {
|
static char *x86emu_fpu_op_df_tab[] =
|
||||||
|
{
|
||||||
/* mod == 00 */
|
/* mod == 00 */
|
||||||
"FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
|
"FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
|
||||||
"FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
|
"FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
|
||||||
@@ -875,7 +922,8 @@ void x86emuOp_esc_coprocess_df(uint8_t X86EMU_UNUSED(op1))
|
|||||||
START_OF_INSTR();
|
START_OF_INSTR();
|
||||||
FETCH_DECODE_MODRM(mod, rh, rl);
|
FETCH_DECODE_MODRM(mod, rh, rl);
|
||||||
DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
|
DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab, mod, rh, rl);
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
destoffset = decode_rm00_address(rl);
|
destoffset = decode_rm00_address(rl);
|
||||||
DECODE_PRINTF("\r\n");
|
DECODE_PRINTF("\r\n");
|
||||||
@@ -894,9 +942,11 @@ void x86emuOp_esc_coprocess_df(uint8_t X86EMU_UNUSED(op1))
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef X86EMU_FPU_PRESENT
|
#ifdef X86EMU_FPU_PRESENT
|
||||||
switch (mod) {
|
switch (mod)
|
||||||
|
{
|
||||||
case 3:
|
case 3:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_R_ffree(stkelem);
|
x86emu_fpu_R_ffree(stkelem);
|
||||||
break;
|
break;
|
||||||
@@ -915,7 +965,8 @@ void x86emuOp_esc_coprocess_df(uint8_t X86EMU_UNUSED(op1))
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
switch (rh) {
|
switch (rh)
|
||||||
|
{
|
||||||
case 0:
|
case 0:
|
||||||
x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
|
x86emu_fpu_M_fild(X86EMU_FPU_WORD, destoffset);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user