Author: aandrejevic Date: Sun Nov 10 23:42:57 2013 New Revision: 60927
URL: http://svn.reactos.org/svn/reactos?rev=60927&view=rev Log: [FAST486] Don't mix up ADSIZE and OPSIZE (continued).
Modified: branches/ntvdm/lib/fast486/opcodes.c
Modified: branches/ntvdm/lib/fast486/opcodes.c URL: http://svn.reactos.org/svn/reactos/branches/ntvdm/lib/fast486/opcodes.c?rev=... ============================================================================== --- branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] (original) +++ branches/ntvdm/lib/fast486/opcodes.c [iso-8859-1] Sun Nov 10 23:42:57 2013 @@ -5133,15 +5133,15 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovAlOffset) { - BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; ULONG Offset;
/* Make sure this is the right instruction */ ASSERT(Opcode == 0xA0);
- TOGGLE_OPSIZE(Size); - - if (Size) + TOGGLE_ADSIZE(AddressSize); + + if (AddressSize) { if (!Fast486FetchDword(State, &Offset)) { @@ -5174,14 +5174,17 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovEaxOffset) { - BOOLEAN Size = State->SegmentRegs[FAST486_REG_CS].Size; + BOOLEAN OperandSize, AddressSize; + + OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
/* Make sure this is the right instruction */ ASSERT(Opcode == 0xA1);
- TOGGLE_OPSIZE(Size); - - if (Size) + TOGGLE_OPSIZE(OperandSize); + TOGGLE_ADSIZE(AddressSize); + + if (AddressSize) { ULONG Offset;
@@ -5192,13 +5195,26 @@ }
/* Read from memory */ - return Fast486ReadMemory(State, - (State->PrefixFlags & FAST486_PREFIX_SEG) ? - State->SegmentOverride : FAST486_REG_DS, - Offset, - FALSE, - &State->GeneralRegs[FAST486_REG_EAX].Long, - sizeof(ULONG)); + if (OperandSize) + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].Long, + sizeof(ULONG)); + } + else + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].LowWord, + sizeof(USHORT)); + } } else { @@ -5211,13 +5227,26 @@ }
/* Read from memory */ - return Fast486ReadMemory(State, - (State->PrefixFlags & FAST486_PREFIX_SEG) ? - State->SegmentOverride : FAST486_REG_DS, - Offset, - FALSE, - &State->GeneralRegs[FAST486_REG_EAX].LowWord, - sizeof(USHORT)); + if (OperandSize) + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].Long, + sizeof(ULONG)); + } + else + { + return Fast486ReadMemory(State, + (State->PrefixFlags & FAST486_PREFIX_SEG) ? + State->SegmentOverride : FAST486_REG_DS, + Offset, + FALSE, + &State->GeneralRegs[FAST486_REG_EAX].LowWord, + sizeof(USHORT)); + } } }