Previous 15994 Revisions Next

r15979 Monday 20th August, 2012 at 12:59:39 UTC by Miodrag Milanović
Fix of a fix (nw)
[src/emu/cpu/i386]i386op16.c i386op32.c i386ops.c i386ops.h

src/emu/cpu/i386/i386op16.c
r15978r15979
36703670   CYCLES(cpustate,CYCLES_RET_IMM_INTERSEG);
36713671}
36723672
3673static void I386OP(xlat16)(i386_state *cpustate)         // Opcode 0xd7
3674{
3675   UINT32 ea;
3676   if( cpustate->segment_prefix ) {
3677      if(cpustate->address_size)
3678      {
3679         ea = i386_translate(cpustate, cpustate->segment_override, REG32(BX) + REG8(AL), 0 );
3680      }
3681      else
3682      {
3683         ea = i386_translate(cpustate, cpustate->segment_override, REG16(EBX) + REG8(AL), 0 );
3684      }
3685   } else {
3686      if(cpustate->address_size)
3687      {
3688         ea = i386_translate(cpustate, DS, REG32(BX) + REG8(AL), 0 );
3689      }
3690      else
3691      {
3692         ea = i386_translate(cpustate, DS, REG16(EBX) + REG8(AL), 0 );
3693      }
3694   }
3695   REG8(AL) = READ8(cpustate,ea);
3696   CYCLES(cpustate,CYCLES_XLAT);
3697}
3698
36993673static void I386OP(load_far_pointer16)(i386_state *cpustate, int s)
37003674{
37013675   UINT8 modrm = FETCH(cpustate);
src/emu/cpu/i386/i386ops.h
r15978r15979
238238   { 0xD4,      OP_I386,               I386OP(aam),               I386OP(aam),            },
239239   { 0xD5,      OP_I386,               I386OP(aad),               I386OP(aad),            },
240240   { 0xD6,      OP_I386,               I386OP(setalc),               I386OP(setalc),            },
241   { 0xD7,      OP_I386,               I386OP(xlat16),               I386OP(xlat32),            },
241   { 0xD7,      OP_I386,               I386OP(xlat),               I386OP(xlat),            },
242242   { 0xD8,      OP_I386,               I386OP(escape),               I386OP(escape),            },
243243   { 0xD9,      OP_I386,               I386OP(escape),               I386OP(escape),            },
244244   { 0xDA,      OP_I386,               I386OP(escape),               I386OP(escape),            },
src/emu/cpu/i386/i386ops.c
r15978r15979
24892489   report_invalid_opcode(cpustate);
24902490   i386_trap(cpustate, 6, 0, 0);
24912491}
2492
2493static void I386OP(xlat)(i386_state *cpustate)         // Opcode 0xd7
2494{
2495   UINT32 ea;
2496   if( cpustate->segment_prefix ) {
2497      if(cpustate->address_size)
2498      {
2499         ea = i386_translate(cpustate, cpustate->segment_override, REG16(BX) + REG8(AL), 0 );
2500      }
2501      else
2502      {
2503         ea = i386_translate(cpustate, cpustate->segment_override, REG32(EBX) + REG8(AL), 0 );
2504      }
2505   } else {
2506      if(cpustate->address_size)
2507      {
2508         ea = i386_translate(cpustate, DS, REG16(BX) + REG8(AL), 0 );
2509      }
2510      else
2511      {
2512         ea = i386_translate(cpustate, DS, REG32(EBX) + REG8(AL), 0 );
2513      }
2514   }
2515   REG8(AL) = READ8(cpustate,ea);
2516   CYCLES(cpustate,CYCLES_XLAT);
2517}
src/emu/cpu/i386/i386op32.c
r15978r15979
34683468   CYCLES(cpustate,CYCLES_RET_IMM_INTERSEG);
34693469}
34703470
3471static void I386OP(xlat32)(i386_state *cpustate)         // Opcode 0xd7
3472{
3473   UINT32 ea;
3474   if( cpustate->segment_prefix ) {
3475      if(cpustate->address_size)
3476      {
3477         ea = i386_translate(cpustate, cpustate->segment_override, REG16(BX) + REG8(AL), 0 );
3478      }
3479      else
3480      {
3481         ea = i386_translate(cpustate, cpustate->segment_override, REG32(EBX) + REG8(AL), 0 );
3482      }
3483   } else {
3484      if(cpustate->address_size)
3485      {
3486         ea = i386_translate(cpustate, DS, REG16(BX) + REG8(AL), 0 );
3487      }
3488      else
3489      {
3490         ea = i386_translate(cpustate, DS, REG32(EBX) + REG8(AL), 0 );
3491      }
3492   }
3493   REG8(AL) = READ8(cpustate,ea);
3494   CYCLES(cpustate,CYCLES_XLAT);
3495}
3496
34973471static void I386OP(load_far_pointer32)(i386_state *cpustate, int s)
34983472{
34993473   UINT8 modrm = FETCH(cpustate);

Previous 15994 Revisions Next


© 1998-2018 The MESS Team