From bb0840fbe046593dbd4b2e94a1b11be952b3ff1a Mon Sep 17 00:00:00 2001 From: OBattler Date: Tue, 25 Jul 2017 00:36:17 +0200 Subject: [PATCH] Applied the last two mainline PCem commits; Restored the Mouse Systems mouse identify byte back to 'H'. --- src/CPU/386_dynarec_ops.c | 2 - src/CPU/386_ops.h | 267 ++++++++++++++++++-------------------- src/CPU/x86_ops_rep.h | 50 ++----- src/CPU/x86seg.c | 149 +++++++++------------ src/mouse_serial.c | 2 +- 5 files changed, 206 insertions(+), 264 deletions(-) diff --git a/src/CPU/386_dynarec_ops.c b/src/CPU/386_dynarec_ops.c index db6958e5a..e0e018872 100644 --- a/src/CPU/386_dynarec_ops.c +++ b/src/CPU/386_dynarec_ops.c @@ -17,8 +17,6 @@ #include "386_common.h" -extern int trap; - extern uint16_t *mod1add[2][8]; extern uint32_t *mod1seg[8]; diff --git a/src/CPU/386_ops.h b/src/CPU/386_ops.h index 71a6f1e4b..17d27c7fb 100644 --- a/src/CPU/386_ops.h +++ b/src/CPU/386_ops.h @@ -227,17 +227,6 @@ static int op0F_l_a32(uint32_t fetchdat) return x86_opcodes_0f[opcode | 0x300](fetchdat >> 8); } -static int opREP_ignore(uint32_t fetchdat) -{ - fetchdat = fastreadl(cs + cpu_state.pc); - if (cpu_state.abrt) return 0; - cpu_state.pc++; - - CLOCK_CYCLES((is486) ? 1 : 3); - PREFETCH_PREFIX(); - return x86_opcodes[(fetchdat & 0xff) | cpu_state.op32](fetchdat >> 8); -} - OpFn OP_TABLE(286_0f)[1024] = { /*16-bit data, 16-bit addr*/ @@ -1427,180 +1416,180 @@ OpFn OP_TABLE(REPE)[1024] = { /*16-bit data, 16-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPE_w_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPE_w_a16,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPE_w_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPE_w_a16,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPE_w_a16,0, 0, 0, 0, 0, 0, 0, opCS_REPE_w_a16,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPE_w_a16,0, 0, 0, 0, 0, 0, 0, opDS_REPE_w_a16,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPE_w_a16,opGS_REPE_w_a16,op_66_REPE, op_67_REPE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a16, opREP_INSW_a16, opREP_OUTSB_a16,opREP_OUTSW_a16, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPE_w_a16,opGS_REPE_w_a16,op_66_REPE, op_67_REPE, 0, 0, 0, 0, opREP_INSB_a16, opREP_INSW_a16, opREP_OUTSB_a16,opREP_OUTSW_a16, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a16,opREP_MOVSW_a16,opREP_CMPSB_a16_E,opREP_CMPSW_a16_E,opREP_ignore, opREP_ignore, opREP_STOSB_a16,opREP_STOSW_a16,opREP_LODSB_a16,opREP_LODSW_a16,opREP_SCASB_a16_E,opREP_SCASW_a16_E, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a16,opREP_MOVSW_a16,opREP_CMPSB_a16_E,opREP_CMPSW_a16_E,0, 0, opREP_STOSB_a16,opREP_STOSW_a16,opREP_LODSB_a16,opREP_LODSW_a16,opREP_SCASB_a16_E,opREP_SCASW_a16_E, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*32-bit data, 16-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPE_l_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPE_l_a16,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPE_l_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPE_l_a16,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPE_l_a16,0, 0, 0, 0, 0, 0, 0, opCS_REPE_l_a16,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPE_l_a16,0, 0, 0, 0, 0, 0, 0, opDS_REPE_l_a16,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPE_l_a16,opGS_REPE_l_a16,op_66_REPE, op_67_REPE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a16, opREP_INSL_a16, opREP_OUTSB_a16,opREP_OUTSL_a16, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPE_l_a16,opGS_REPE_l_a16,op_66_REPE, op_67_REPE, 0, 0, 0, 0, opREP_INSB_a16, opREP_INSL_a16, opREP_OUTSB_a16,opREP_OUTSL_a16, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a16,opREP_MOVSL_a16,opREP_CMPSB_a16_E,opREP_CMPSL_a16_E,opREP_ignore, opREP_ignore, opREP_STOSB_a16,opREP_STOSL_a16,opREP_LODSB_a16,opREP_LODSL_a16,opREP_SCASB_a16_E,opREP_SCASL_a16_E, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a16,opREP_MOVSL_a16,opREP_CMPSB_a16_E,opREP_CMPSL_a16_E,0, 0, opREP_STOSB_a16,opREP_STOSL_a16,opREP_LODSB_a16,opREP_LODSL_a16,opREP_SCASB_a16_E,opREP_SCASL_a16_E, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*16-bit data, 32-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPE_w_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPE_w_a32,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPE_w_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPE_w_a32,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPE_w_a32,0, 0, 0, 0, 0, 0, 0, opCS_REPE_w_a32,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPE_w_a32,0, 0, 0, 0, 0, 0, 0, opDS_REPE_w_a32,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPE_w_a32,opGS_REPE_w_a32,op_66_REPE, op_67_REPE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a32, opREP_INSW_a32, opREP_OUTSB_a32,opREP_OUTSW_a32, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPE_w_a32,opGS_REPE_w_a32,op_66_REPE, op_67_REPE, 0, 0, 0, 0, opREP_INSB_a32, opREP_INSW_a32, opREP_OUTSB_a32,opREP_OUTSW_a32, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a32,opREP_MOVSW_a32,opREP_CMPSB_a32_E,opREP_CMPSW_a32_E,opREP_ignore, opREP_ignore, opREP_STOSB_a32,opREP_STOSW_a32,opREP_LODSB_a32,opREP_LODSW_a32,opREP_SCASB_a32_E,opREP_SCASW_a32_E, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a32,opREP_MOVSW_a32,opREP_CMPSB_a32_E,opREP_CMPSW_a32_E,0, 0, opREP_STOSB_a32,opREP_STOSW_a32,opREP_LODSB_a32,opREP_LODSW_a32,opREP_SCASB_a32_E,opREP_SCASW_a32_E, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*32-bit data, 32-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPE_l_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPE_l_a32,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPE_l_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPE_l_a32,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPE_l_a32,0, 0, 0, 0, 0, 0, 0, opCS_REPE_l_a32,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPE_l_a32,0, 0, 0, 0, 0, 0, 0, opDS_REPE_l_a32,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPE_l_a32,opGS_REPE_l_a32,op_66_REPE, op_67_REPE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a32, opREP_INSL_a32, opREP_OUTSB_a32,opREP_OUTSL_a32, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPE_l_a32,opGS_REPE_l_a32,op_66_REPE, op_67_REPE, 0, 0, 0, 0, opREP_INSB_a32, opREP_INSL_a32, opREP_OUTSB_a32,opREP_OUTSL_a32, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a32,opREP_MOVSL_a32,opREP_CMPSB_a32_E,opREP_CMPSL_a32_E,opREP_ignore, opREP_ignore, opREP_STOSB_a32,opREP_STOSL_a32,opREP_LODSB_a32,opREP_LODSL_a32,opREP_SCASB_a32_E,opREP_SCASL_a32_E, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a32,opREP_MOVSL_a32,opREP_CMPSB_a32_E,opREP_CMPSL_a32_E,0, 0, opREP_STOSB_a32,opREP_STOSL_a32,opREP_LODSB_a32,opREP_LODSL_a32,opREP_SCASB_a32_E,opREP_SCASL_a32_E, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; OpFn OP_TABLE(REPNE)[1024] = { /*16-bit data, 16-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPNE_w_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPNE_w_a16,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPNE_w_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPNE_w_a16,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPNE_w_a16,0, 0, 0, 0, 0, 0, 0, opCS_REPNE_w_a16,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPNE_w_a16,0, 0, 0, 0, 0, 0, 0, opDS_REPNE_w_a16,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPNE_w_a16,opGS_REPNE_w_a16,op_66_REPNE, op_67_REPNE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a16, opREP_INSW_a16, opREP_OUTSB_a16,opREP_OUTSW_a16, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPNE_w_a16,opGS_REPNE_w_a16,op_66_REPNE, op_67_REPNE, 0, 0, 0, 0, opREP_INSB_a16, opREP_INSW_a16, opREP_OUTSB_a16,opREP_OUTSW_a16, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a16,opREP_MOVSW_a16,opREP_CMPSB_a16_NE,opREP_CMPSW_a16_NE,opREP_ignore, opREP_ignore, opREP_STOSB_a16,opREP_STOSW_a16,opREP_LODSB_a16,opREP_LODSW_a16,opREP_SCASB_a16_NE,opREP_SCASW_a16_NE, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a16,opREP_MOVSW_a16,opREP_CMPSB_a16_NE,opREP_CMPSW_a16_NE,0, 0, opREP_STOSB_a16,opREP_STOSW_a16,opREP_LODSB_a16,opREP_LODSW_a16,opREP_SCASB_a16_NE,opREP_SCASW_a16_NE, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*32-bit data, 16-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPNE_l_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPNE_l_a16,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPNE_l_a16,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPNE_l_a16,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPNE_l_a16,0, 0, 0, 0, 0, 0, 0, opCS_REPNE_l_a16,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPNE_l_a16,0, 0, 0, 0, 0, 0, 0, opDS_REPNE_l_a16,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPNE_l_a16,opGS_REPNE_l_a16,op_66_REPNE, op_67_REPNE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a16, opREP_INSL_a16, opREP_OUTSB_a16,opREP_OUTSL_a16, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPNE_l_a16,opGS_REPNE_l_a16,op_66_REPNE, op_67_REPNE, 0, 0, 0, 0, opREP_INSB_a16, opREP_INSL_a16, opREP_OUTSB_a16,opREP_OUTSL_a16, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a16,opREP_MOVSL_a16,opREP_CMPSB_a16_NE,opREP_CMPSL_a16_NE,opREP_ignore, opREP_ignore, opREP_STOSB_a16,opREP_STOSL_a16,opREP_LODSB_a16,opREP_LODSL_a16,opREP_SCASB_a16_NE,opREP_SCASL_a16_NE, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a16,opREP_MOVSL_a16,opREP_CMPSB_a16_NE,opREP_CMPSL_a16_NE,0, 0, opREP_STOSB_a16,opREP_STOSL_a16,opREP_LODSB_a16,opREP_LODSL_a16,opREP_SCASB_a16_NE,opREP_SCASL_a16_NE, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*16-bit data, 32-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPNE_w_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPNE_w_a32,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPNE_w_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPNE_w_a32,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPNE_w_a32,0, 0, 0, 0, 0, 0, 0, opCS_REPNE_w_a32,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPNE_w_a32,0, 0, 0, 0, 0, 0, 0, opDS_REPNE_w_a32,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPNE_w_a32,opGS_REPNE_w_a32,op_66_REPNE, op_67_REPNE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a32, opREP_INSW_a32, opREP_OUTSB_a32,opREP_OUTSW_a32, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPNE_w_a32,opGS_REPNE_w_a32,op_66_REPNE, op_67_REPNE, 0, 0, 0, 0, opREP_INSB_a32, opREP_INSW_a32, opREP_OUTSB_a32,opREP_OUTSW_a32, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a32,opREP_MOVSW_a32,opREP_CMPSB_a32_NE,opREP_CMPSW_a32_NE,opREP_ignore, opREP_ignore, opREP_STOSB_a32,opREP_STOSW_a32,opREP_LODSB_a32,opREP_LODSW_a32,opREP_SCASB_a32_NE,opREP_SCASW_a32_NE, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a32,opREP_MOVSW_a32,opREP_CMPSB_a32_NE,opREP_CMPSW_a32_NE,0, 0, opREP_STOSB_a32,opREP_STOSW_a32,opREP_LODSB_a32,opREP_LODSW_a32,opREP_SCASB_a32_NE,opREP_SCASW_a32_NE, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /*32-bit data, 32-bit addr*/ /* 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f*/ -/*00*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*10*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*20*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opES_REPNE_l_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opCS_REPNE_l_a32,opREP_ignore, -/*30*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opSS_REPNE_l_a32,opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opDS_REPNE_l_a32,opREP_ignore, +/*00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*20*/ 0, 0, 0, 0, 0, 0, opES_REPNE_l_a32,0, 0, 0, 0, 0, 0, 0, opCS_REPNE_l_a32,0, +/*30*/ 0, 0, 0, 0, 0, 0, opSS_REPNE_l_a32,0, 0, 0, 0, 0, 0, 0, opDS_REPNE_l_a32,0, -/*40*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*50*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*60*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opFS_REPNE_l_a32,opGS_REPNE_l_a32,op_66_REPNE, op_67_REPNE, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_INSB_a32, opREP_INSL_a32, opREP_OUTSB_a32,opREP_OUTSL_a32, -/*70*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*40*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*50*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*60*/ 0, 0, 0, 0, opFS_REPNE_l_a32,opGS_REPNE_l_a32,op_66_REPNE, op_67_REPNE, 0, 0, 0, 0, opREP_INSB_a32, opREP_INSL_a32, opREP_OUTSB_a32,opREP_OUTSL_a32, +/*70*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*80*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*90*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*a0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_MOVSB_a32,opREP_MOVSL_a32,opREP_CMPSB_a32_NE,opREP_CMPSL_a32_NE,opREP_ignore, opREP_ignore, opREP_STOSB_a32,opREP_STOSL_a32,opREP_LODSB_a32,opREP_LODSL_a32,opREP_SCASB_a32_NE,opREP_SCASL_a32_NE, -/*b0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*80*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*90*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*a0*/ 0, 0, 0, 0, opREP_MOVSB_a32,opREP_MOVSL_a32,opREP_CMPSB_a32_NE,opREP_CMPSL_a32_NE,0, 0, opREP_STOSB_a32,opREP_STOSL_a32,opREP_LODSB_a32,opREP_LODSL_a32,opREP_SCASB_a32_NE,opREP_SCASL_a32_NE, +/*b0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -/*c0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*d0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*e0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, -/*f0*/ opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, opREP_ignore, +/*c0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*d0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*e0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, +/*f0*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; diff --git a/src/CPU/x86_ops_rep.h b/src/CPU/x86_ops_rep.h index b26b3be3d..065695706 100644 --- a/src/CPU/x86_ops_rep.h +++ b/src/CPU/x86_ops_rep.h @@ -1,3 +1,5 @@ +extern int trap; + #define REP_OPS(size, CNT_REG, SRC_REG, DEST_REG) \ static int opREP_INSB_ ## size(uint32_t fetchdat) \ { \ @@ -166,10 +168,8 @@ static int opREP_MOVSB_ ## size(uint32_t fetchdat) { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ uint8_t temp; \ @@ -201,10 +201,8 @@ static int opREP_MOVSW_ ## size(uint32_t fetchdat) { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ uint16_t temp; \ @@ -236,10 +234,8 @@ static int opREP_MOVSL_ ## size(uint32_t fetchdat) { \ int reads = 0, writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ uint32_t temp; \ @@ -273,10 +269,8 @@ static int opREP_STOSB_ ## size(uint32_t fetchdat) { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ CHECK_WRITE_REP(&_es, DEST_REG, DEST_REG); \ @@ -303,10 +297,8 @@ static int opREP_STOSW_ ## size(uint32_t fetchdat) { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ CHECK_WRITE_REP(&_es, DEST_REG, DEST_REG+1); \ @@ -333,10 +325,8 @@ static int opREP_STOSL_ ## size(uint32_t fetchdat) { \ int writes = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ CHECK_WRITE_REP(&_es, DEST_REG, DEST_REG+3); \ @@ -364,10 +354,8 @@ static int opREP_LODSB_ ## size(uint32_t fetchdat) { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ AL = readmemb(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ @@ -393,10 +381,8 @@ static int opREP_LODSW_ ## size(uint32_t fetchdat) { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ AX = readmemw(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ @@ -422,10 +408,8 @@ static int opREP_LODSL_ ## size(uint32_t fetchdat) { \ int reads = 0, total_cycles = 0; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ while (CNT_REG > 0) \ { \ EAX = readmeml(cpu_state.ea_seg->base, SRC_REG); if (cpu_state.abrt) return 1; \ @@ -536,10 +520,8 @@ static int opREP_SCASB_ ## size(uint32_t fetchdat) { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ tempz = FV; \ while ((CNT_REG > 0) && (FV == tempz)) \ { \ @@ -569,10 +551,8 @@ static int opREP_SCASW_ ## size(uint32_t fetchdat) { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ tempz = FV; \ while ((CNT_REG > 0) && (FV == tempz)) \ { \ @@ -602,10 +582,8 @@ static int opREP_SCASL_ ## size(uint32_t fetchdat) { \ int reads = 0, total_cycles = 0, tempz; \ int cycles_end = cycles - ((is386 && cpu_use_dynarec) ? 1000 : 100); \ - \ if (trap) \ - cycles_end = cycles+1; \ - \ + cycles_end = cycles+1; /*Force the instruction to end after only one iteration when trap flag set*/ \ tempz = FV; \ while ((CNT_REG > 0) && (FV == tempz)) \ { \ diff --git a/src/CPU/x86seg.c b/src/CPU/x86seg.c index 9fa8cf8f9..177a555ca 100644 --- a/src/CPU/x86seg.c +++ b/src/CPU/x86seg.c @@ -2133,7 +2133,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) base=segdat[1]|((segdat[2]&0xFF)<<16); limit=segdat[0]; - if(is386) { base |= (segdat[3]>>8)<<24; @@ -2144,7 +2143,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) { if (limit < 103) { - pclog("32-bit TSS %04X limit less than 103.\n", seg); x86ts(NULL, seg); return; } @@ -2161,7 +2159,7 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) if (cpu_state.abrt) return; if (optype==IRET) flags&=~NT_FLAG; - + cpu_386_flags_rebuild(); writememl(tr.base,0x1C,cr3); writememl(tr.base,0x20,cpu_state.pc); @@ -2200,14 +2198,14 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) if (cpu_state.abrt) return; } + new_cr3=readmeml(base,0x1C); new_pc=readmeml(base,0x20); new_flags=readmeml(base,0x24); - if (optype == OPTYPE_INT || optype == CALL) new_flags |= NT_FLAG; - + new_eax=readmeml(base,0x28); new_ecx=readmeml(base,0x2C); new_edx=readmeml(base,0x30); @@ -2245,70 +2243,72 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) } ldt.base=(readmemw(0,templ+2))|(readmemb(0,templ+4)<<16)|(readmemb(0,templ+7)<<24); - if (eflags&VM_FLAG) + if (eflags & VM_FLAG) { - x86gpf(NULL,0); - return; - } - - if (!(new_cs&~3)) - { - x86ts(NULL,0); - return; - } - addr=new_cs&~7; - if (new_cs&4) - { - if (addr>=ldt.limit) - { - x86ts(NULL,new_cs&~3); - return; - } - addr+=ldt.base; + loadcs(new_cs); + set_use32(0); } else { - if (addr>=gdt.limit) + if (!(new_cs&~3)) { + x86ts(NULL,0); + return; + } + addr=new_cs&~7; + if (new_cs&4) + { + if (addr>=ldt.limit) + { + x86ts(NULL,new_cs&~3); + return; + } + addr+=ldt.base; + } + else + { + if (addr>=gdt.limit) + { + x86ts(NULL,new_cs&~3); + return; + } + addr+=gdt.base; + } + segdat2[0]=readmemw(0,addr); + segdat2[1]=readmemw(0,addr+2); + segdat2[2]=readmemw(0,addr+4); + segdat2[3]=readmemw(0,addr+6); + if (!(segdat2[2]&0x8000)) + { + x86np("TS loading CS not present\n", new_cs & 0xfffc); + return; + } + switch (segdat2[2]&0x1F00) + { + case 0x1800: case 0x1900: case 0x1A00: case 0x1B00: /*Non-conforming*/ + if ((new_cs&3) != DPL2) + { + x86ts(NULL,new_cs&~3); + return; + } + break; + case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/ + if ((new_cs&3) < DPL2) + { + x86ts(NULL,new_cs&~3); + return; + } + break; + default: x86ts(NULL,new_cs&~3); return; } - addr+=gdt.base; - } - segdat2[0]=readmemw(0,addr); - segdat2[1]=readmemw(0,addr+2); - segdat2[2]=readmemw(0,addr+4); - segdat2[3]=readmemw(0,addr+6); - if (!(segdat2[2]&0x8000)) - { - x86np("TS loading CS not present\n", new_cs & 0xfffc); - return; - } - switch (segdat2[2]&0x1F00) - { - case 0x1800: case 0x1900: case 0x1A00: case 0x1B00: /*Non-conforming*/ - if ((new_cs&3) != DPL2) - { - x86ts(NULL,new_cs&~3); - return; - } - break; - case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/ - if ((new_cs&3) < DPL2) - { - x86ts(NULL,new_cs&~3); - return; - } - break; - default: - x86ts(NULL,new_cs&~3); - return; - } - CS=new_cs; - do_seg_load(&_cs, segdat2); - if (CPL==3 && oldcpl!=3) flushmmucache_cr3(); - set_use32(segdat2[3] & 0x40); + CS=new_cs; + do_seg_load(&_cs, segdat2); + if (CPL==3 && oldcpl!=3) flushmmucache_cr3(); + set_use32(segdat2[3] & 0x40); + } EAX=new_eax; ECX=new_ecx; @@ -2319,28 +2319,20 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) ESI=new_esi; EDI=new_edi; - if (output) pclog("Load ES %04X\n",new_es); loadseg(new_es,&_es); - if (output) pclog("Load SS %04X\n",new_ss); loadseg(new_ss,&_ss); - if (output) pclog("Load DS %04X\n",new_ds); loadseg(new_ds,&_ds); - if (output) pclog("Load FS %04X\n",new_fs); loadseg(new_fs,&_fs); - if (output) pclog("Load GS %04X\n",new_gs); loadseg(new_gs,&_gs); - - if (output) pclog("Resuming at %04X:%08X\n",CS,cpu_state.pc); } else { if (limit < 43) { - pclog("16-bit TSS %04X limit less than 43.\n", seg); x86ts(NULL, seg); return; } - + if (optype==JMP || optype==CALL || optype==OPTYPE_INT) { if (tr.seg&4) tempw=readmemw(ldt.base,(seg&~7)+4); @@ -2353,7 +2345,7 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) if (cpu_state.abrt) return; if (optype==IRET) flags&=~NT_FLAG; - + cpu_386_flags_rebuild(); writememw(tr.base,0x0E,cpu_state.pc); writememw(tr.base,0x10,flags); @@ -2392,15 +2384,13 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) new_pc=readmemw(base,0x0E); new_flags=readmemw(base,0x10); - if (optype == OPTYPE_INT || optype == CALL) new_flags |= NT_FLAG; - + new_eax=readmemw(base,0x12); new_ecx=readmemw(base,0x14); new_edx=readmemw(base,0x16); new_ebx=readmemw(base,0x18); - new_esp=readmemw(base,0x1A); new_ebp=readmemw(base,0x1C); new_esi=readmemw(base,0x1E); @@ -2434,7 +2424,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) if (!(new_cs&~3)) { - pclog("TS loading null CS\n"); x86ts(NULL,0); return; } @@ -2443,7 +2432,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) { if (addr>=ldt.limit) { - pclog("Bigger than LDT limit %04X %04X %04X TS\n",new_cs,ldt.limit,addr); x86ts(NULL,new_cs&~3); return; } @@ -2453,7 +2441,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) { if (addr>=gdt.limit) { - pclog("Bigger than GDT limit %04X %04X TS\n",new_cs,gdt.limit); x86ts(NULL,new_cs&~3); return; } @@ -2465,7 +2452,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) segdat2[3]=readmemw(0,addr+6); if (!(segdat2[2]&0x8000)) { - pclog("TS loading CS not present\n"); x86np("TS loading CS not present\n", new_cs & 0xfffc); return; } @@ -2474,7 +2460,6 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) case 0x1800: case 0x1900: case 0x1A00: case 0x1B00: /*Non-conforming*/ if ((new_cs&3) != DPL2) { - pclog("TS load CS non-conforming RPL != DPL"); x86ts(NULL,new_cs&~3); return; } @@ -2482,13 +2467,11 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) case 0x1C00: case 0x1D00: case 0x1E00: case 0x1F00: /*Conforming*/ if ((new_cs&3) < DPL2) { - pclog("TS load CS non-conforming RPL < DPL"); x86ts(NULL,new_cs&~3); return; } break; default: - pclog("TS load CS not code segment\n"); x86ts(NULL,new_cs&~3); return; } @@ -2507,19 +2490,14 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) ESI=new_esi | 0xFFFF0000; EDI=new_edi | 0xFFFF0000; - if (output) pclog("Load ES %04X\n",new_es); loadseg(new_es,&_es); - if (output) pclog("Load SS %04X\n",new_ss); loadseg(new_ss,&_ss); - if (output) pclog("Load DS %04X\n",new_ds); loadseg(new_ds,&_ds); if (is386) { loadseg(0,&_fs); loadseg(0,&_gs); } - - if (output) pclog("Resuming at %04X:%08X\n",CS,cpu_state.pc); } tr.seg=seg; @@ -2527,4 +2505,3 @@ void taskswitch286(uint16_t seg, uint16_t *segdat, int is32) tr.limit=limit; tr.access=segdat[2]>>8; } - diff --git a/src/mouse_serial.c b/src/mouse_serial.c index 8fe228093..bbad6b0d8 100644 --- a/src/mouse_serial.c +++ b/src/mouse_serial.c @@ -349,7 +349,7 @@ void mousecallback(void *p) switch(mouse->type) { case 0: - serial_write_fifo(mouse->serial, 'M'); + serial_write_fifo(mouse->serial, 'H'); break; case 1: default: