-i386: xlat implementation fix [Alegend45]

This commit is contained in:
Miodrag Milanovic 2012-08-20 11:18:56 +00:00
parent f54800c1f3
commit a49a951ae9
2 changed files with 32 additions and 4 deletions

View File

@ -3674,9 +3674,23 @@ static void I386OP(xlat16)(i386_state *cpustate) // Opcode 0xd7
{
UINT32 ea;
if( cpustate->segment_prefix ) {
ea = i386_translate(cpustate, cpustate->segment_override, REG16(BX) + REG8(AL), 0 );
if(cpustate->address_size)
{
ea = i386_translate(cpustate, cpustate->segment_override, REG32(BX) + REG8(AL), 0 );
}
else
{
ea = i386_translate(cpustate, cpustate->segment_override, REG16(EBX) + REG8(AL), 0 );
}
} else {
ea = i386_translate(cpustate, DS, REG16(BX) + REG8(AL), 0 );
if(cpustate->address_size)
{
ea = i386_translate(cpustate, DS, REG32(BX) + REG8(AL), 0 );
}
else
{
ea = i386_translate(cpustate, DS, REG16(EBX) + REG8(AL), 0 );
}
}
REG8(AL) = READ8(cpustate,ea);
CYCLES(cpustate,CYCLES_XLAT);

View File

@ -3472,9 +3472,23 @@ static void I386OP(xlat32)(i386_state *cpustate) // Opcode 0xd7
{
UINT32 ea;
if( cpustate->segment_prefix ) {
ea = i386_translate(cpustate, cpustate->segment_override, REG32(EBX) + REG8(AL), 0 );
if(cpustate->address_size)
{
ea = i386_translate(cpustate, cpustate->segment_override, REG16(BX) + REG8(AL), 0 );
}
else
{
ea = i386_translate(cpustate, cpustate->segment_override, REG32(EBX) + REG8(AL), 0 );
}
} else {
ea = i386_translate(cpustate, DS, REG32(EBX) + REG8(AL), 0 );
if(cpustate->address_size)
{
ea = i386_translate(cpustate, DS, REG16(BX) + REG8(AL), 0 );
}
else
{
ea = i386_translate(cpustate, DS, REG32(EBX) + REG8(AL), 0 );
}
}
REG8(AL) = READ8(cpustate,ea);
CYCLES(cpustate,CYCLES_XLAT);