Author: aandrejevic
Date: Sun Nov 10 23:34:34 2013
New Revision: 60926
URL:
http://svn.reactos.org/svn/reactos?rev=60926&view=rev
Log:
[FAST486]
Don't mix up ADSIZE and OPSIZE.
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:34:34 2013
@@ -5223,15 +5223,15 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetAl)
{
- 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 == 0xA2);
- TOGGLE_OPSIZE(Size);
-
- if (Size)
+ TOGGLE_ADSIZE(AddressSize);
+
+ if (AddressSize)
{
if (!Fast486FetchDword(State, &Offset))
{
@@ -5263,14 +5263,17 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovOffsetEax)
{
- 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 == 0xA3);
- TOGGLE_OPSIZE(Size);
-
- if (Size)
+ TOGGLE_OPSIZE(OperandSize);
+ TOGGLE_ADSIZE(AddressSize);
+
+ if (AddressSize)
{
ULONG Offset;
@@ -5281,12 +5284,24 @@
}
/* Write to memory */
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].Long,
- sizeof(ULONG));
+ if (OperandSize)
+ {
+ return Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].Long,
+ sizeof(ULONG));
+ }
+ else
+ {
+ return Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+
&State->GeneralRegs[FAST486_REG_EAX].LowWord,
+ sizeof(USHORT));
+ }
}
else
{
@@ -5299,12 +5314,24 @@
}
/* Write to memory */
- return Fast486WriteMemory(State,
- (State->PrefixFlags & FAST486_PREFIX_SEG) ?
- State->SegmentOverride : FAST486_REG_DS,
- Offset,
- &State->GeneralRegs[FAST486_REG_EAX].LowWord,
- sizeof(USHORT));
+ if (OperandSize)
+ {
+ return Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+ &State->GeneralRegs[FAST486_REG_EAX].Long,
+ sizeof(ULONG));
+ }
+ else
+ {
+ return Fast486WriteMemory(State,
+ (State->PrefixFlags & FAST486_PREFIX_SEG) ?
+ State->SegmentOverride : FAST486_REG_DS,
+ Offset,
+
&State->GeneralRegs[FAST486_REG_EAX].LowWord,
+ sizeof(USHORT));
+ }
}
}