[FAST486]

Fix XLAT and OUTS.


svn path=/trunk/; revision=64374
This commit is contained in:
Aleksandar Andrejevic 2014-09-28 19:07:27 +00:00
parent f9fea3cd4d
commit d3e18a6f2e

View file

@ -4956,7 +4956,8 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeXlat)
/* Read a byte from DS:[(E)BX + AL] */ /* Read a byte from DS:[(E)BX + AL] */
if (!Fast486ReadMemory(State, if (!Fast486ReadMemory(State,
FAST486_REG_DS, (State->PrefixFlags & FAST486_PREFIX_SEG)
? State->SegmentOverride : FAST486_REG_DS,
(AddressSize ? State->GeneralRegs[FAST486_REG_EBX].Long (AddressSize ? State->GeneralRegs[FAST486_REG_EBX].Long
: State->GeneralRegs[FAST486_REG_EBX].LowWord) : State->GeneralRegs[FAST486_REG_EBX].LowWord)
+ State->GeneralRegs[FAST486_REG_EAX].LowByte, + State->GeneralRegs[FAST486_REG_EAX].LowByte,
@ -6214,8 +6215,8 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeOuts)
if (!AddressSize) if (!AddressSize)
{ {
ULONG MaxBytes = State->Flags.Df ULONG MaxBytes = State->Flags.Df
? (ULONG)State->GeneralRegs[FAST486_REG_EDI].LowWord ? (ULONG)State->GeneralRegs[FAST486_REG_ESI].LowWord
: (0x10000 - (ULONG)State->GeneralRegs[FAST486_REG_EDI].LowWord); : (0x10000 - (ULONG)State->GeneralRegs[FAST486_REG_ESI].LowWord);
Processed = min(Processed, MaxBytes / DataSize); Processed = min(Processed, MaxBytes / DataSize);
if (Processed == 0) Processed = 1; if (Processed == 0) Processed = 1;
@ -6223,9 +6224,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeOuts)
/* Read from memory */ /* Read from memory */
if (!Fast486ReadMemory(State, if (!Fast486ReadMemory(State,
FAST486_REG_ES, (State->PrefixFlags & FAST486_PREFIX_SEG)
AddressSize ? State->GeneralRegs[FAST486_REG_EDI].Long ? State->SegmentOverride : FAST486_REG_DS,
: State->GeneralRegs[FAST486_REG_EDI].LowWord, AddressSize ? State->GeneralRegs[FAST486_REG_ESI].Long
: State->GeneralRegs[FAST486_REG_ESI].LowWord,
FALSE, FALSE,
Block, Block,
Processed * DataSize)) Processed * DataSize))
@ -6242,9 +6244,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeOuts)
{ {
ULONG i, j; ULONG i, j;
/* Reduce EDI by the number of bytes to transfer */ /* Reduce ESI by the number of bytes to transfer */
if (AddressSize) State->GeneralRegs[FAST486_REG_EDI].Long -= Processed * DataSize; if (AddressSize) State->GeneralRegs[FAST486_REG_ESI].Long -= Processed * DataSize;
else State->GeneralRegs[FAST486_REG_EDI].LowWord -= Processed * DataSize; else State->GeneralRegs[FAST486_REG_ESI].LowWord -= Processed * DataSize;
/* Reverse the block data */ /* Reverse the block data */
for (i = 0; i < Processed / 2; i++) for (i = 0; i < Processed / 2; i++)
@ -6268,9 +6270,9 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeOuts)
if (!State->Flags.Df) if (!State->Flags.Df)
{ {
/* Increase EDI by the number of bytes transfered */ /* Increase ESI by the number of bytes transfered */
if (AddressSize) State->GeneralRegs[FAST486_REG_EDI].Long += Processed * DataSize; if (AddressSize) State->GeneralRegs[FAST486_REG_ESI].Long += Processed * DataSize;
else State->GeneralRegs[FAST486_REG_EDI].LowWord += Processed * DataSize; else State->GeneralRegs[FAST486_REG_ESI].LowWord += Processed * DataSize;
} }
/* Reduce the total count by the number processed in this run */ /* Reduce the total count by the number processed in this run */
@ -6287,7 +6289,8 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeOuts)
/* Read from the source operand */ /* Read from the source operand */
if (!Fast486ReadMemory(State, if (!Fast486ReadMemory(State,
FAST486_REG_DS, (State->PrefixFlags & FAST486_PREFIX_SEG)
? State->SegmentOverride : FAST486_REG_DS,
AddressSize ? State->GeneralRegs[FAST486_REG_ESI].Long AddressSize ? State->GeneralRegs[FAST486_REG_ESI].Long
: State->GeneralRegs[FAST486_REG_ESI].LowWord, : State->GeneralRegs[FAST486_REG_ESI].LowWord,
FALSE, FALSE,