aboutsummaryrefslogtreecommitdiff
path: root/src/devices/emulator/x86emu/ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/emulator/x86emu/ops.c')
-rw-r--r--src/devices/emulator/x86emu/ops.c51
1 files changed, 19 insertions, 32 deletions
diff --git a/src/devices/emulator/x86emu/ops.c b/src/devices/emulator/x86emu/ops.c
index 2534b65863..4666e93ff4 100644
--- a/src/devices/emulator/x86emu/ops.c
+++ b/src/devices/emulator/x86emu/ops.c
@@ -70,7 +70,7 @@
*
****************************************************************************/
-#include "x86emui.h"
+#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/
@@ -219,7 +219,8 @@ void x86emuOp_genop_byte_RM_R(u8 op1)
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = genop_byte_operation[op1](destval, *srcreg);
- store_data_byte(destoffset, destval);
+ if (op1 != 7)
+ store_data_byte(destoffset, destval);
}
else
{ /* register to register */
@@ -262,7 +263,8 @@ void x86emuOp_genop_word_RM_R(u8 op1)
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = genop_long_operation[op1](destval, *srcreg);
- store_data_long(destoffset, destval);
+ if (op1 != 7)
+ store_data_long(destoffset, destval);
} else {
u16 destval;
u16 *srcreg;
@@ -273,11 +275,12 @@ void x86emuOp_genop_word_RM_R(u8 op1)
DECODE_PRINTF("\n");
TRACE_AND_STEP();
destval = genop_word_operation[op1](destval, *srcreg);
- store_data_word(destoffset, destval);
+ if (op1 != 7)
+ store_data_word(destoffset, destval);
}
} else { /* register to register */
if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg,*srcreg;
+ u32 *destreg, *srcreg;
destreg = DECODE_RM_LONG_REGISTER(rl);
DECODE_PRINTF(",");
@@ -286,7 +289,7 @@ void x86emuOp_genop_word_RM_R(u8 op1)
TRACE_AND_STEP();
*destreg = genop_long_operation[op1](*destreg, *srcreg);
} else {
- u16 *destreg,*srcreg;
+ u16 *destreg, *srcreg;
destreg = DECODE_RM_WORD_REGISTER(rl);
DECODE_PRINTF(",");
@@ -1332,9 +1335,7 @@ void x86emuOp_opc80_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
imm = fetch_byte_imm();
DECODE_PRINTF2("%x\n", imm);
TRACE_AND_STEP();
- destval = (*genop_byte_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
+ *destreg = (*genop_byte_operation[rh]) (*destreg, imm);
}
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
@@ -1423,29 +1424,23 @@ void x86emuOp_opc81_word_RM_IMM(u8 X86EMU_UNUSED(op1))
}
} else { /* register to register */
if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 destval,imm;
+ u32 *destreg, imm;
destreg = DECODE_RM_LONG_REGISTER(rl);
DECODE_PRINTF(",");
imm = fetch_long_imm();
DECODE_PRINTF2("%x\n", imm);
TRACE_AND_STEP();
- destval = (*genop_long_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
+ *destreg = (*genop_long_operation[rh]) (*destreg, imm);
} else {
- u16 *destreg;
- u16 destval,imm;
+ u16 *destreg, imm;
destreg = DECODE_RM_WORD_REGISTER(rl);
DECODE_PRINTF(",");
imm = fetch_word_imm();
DECODE_PRINTF2("%x\n", imm);
TRACE_AND_STEP();
- destval = (*genop_word_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
+ *destreg = (*genop_word_operation[rh]) (*destreg, imm);
}
}
DECODE_CLEAR_SEGOVR();
@@ -1523,9 +1518,7 @@ void x86emuOp_opc82_byte_RM_IMM(u8 X86EMU_UNUSED(op1))
imm = fetch_byte_imm();
DECODE_PRINTF2(",%x\n", imm);
TRACE_AND_STEP();
- destval = (*genop_byte_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
+ *destreg = (*genop_byte_operation[rh]) (*destreg, imm);
}
DECODE_CLEAR_SEGOVR();
END_OF_INSTR();
@@ -1611,27 +1604,21 @@ void x86emuOp_opc83_word_RM_IMM(u8 X86EMU_UNUSED(op1))
}
} else { /* register to register */
if (M.x86.mode & SYSMODE_PREFIX_DATA) {
- u32 *destreg;
- u32 destval,imm;
+ u32 *destreg, imm;
destreg = DECODE_RM_LONG_REGISTER(rl);
imm = (s8) fetch_byte_imm();
DECODE_PRINTF2(",%x\n", imm);
TRACE_AND_STEP();
- destval = (*genop_long_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
+ *destreg = (*genop_long_operation[rh]) (*destreg, imm);
} else {
- u16 *destreg;
- u16 destval,imm;
+ u16 *destreg, imm;
destreg = DECODE_RM_WORD_REGISTER(rl);
imm = (s8) fetch_byte_imm();
DECODE_PRINTF2(",%x\n", imm);
TRACE_AND_STEP();
- destval = (*genop_word_operation[rh]) (*destreg, imm);
- if (rh != 7)
- *destreg = destval;
+ *destreg = (*genop_word_operation[rh]) (*destreg, imm);
}
}
DECODE_CLEAR_SEGOVR();