Author: aandrejevic Date: Tue Apr 28 00:56:56 2015 New Revision: 67463
URL: http://svn.reactos.org/svn/reactos?rev=67463&view=rev Log: [FAST486] The segment loading/storing MOV is always 16-bit and ignores OPSIZE.
Modified: trunk/reactos/lib/fast486/opcodes.c
Modified: trunk/reactos/lib/fast486/opcodes.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/opcodes.c?rev=6... ============================================================================== --- trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/opcodes.c [iso-8859-1] Tue Apr 28 00:56:56 2015 @@ -3832,16 +3832,13 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg) { - BOOLEAN OperandSize, AddressSize; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; FAST486_MOD_REG_RM ModRegRm;
- OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; - /* Make sure this is the right instruction */ ASSERT(Opcode == 0x8C);
TOGGLE_ADSIZE(AddressSize); - TOGGLE_OPSIZE(OperandSize);
/* Get the operands */ if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) @@ -3857,20 +3854,10 @@ return; }
- if (OperandSize) - { - Fast486WriteModrmDwordOperands(State, - &ModRegRm, - FALSE, - State->SegmentRegs[ModRegRm.Register].Selector); - } - else - { - Fast486WriteModrmWordOperands(State, - &ModRegRm, - FALSE, - State->SegmentRegs[ModRegRm.Register].Selector); - } + Fast486WriteModrmWordOperands(State, + &ModRegRm, + FALSE, + State->SegmentRegs[ModRegRm.Register].Selector); }
FAST486_OPCODE_HANDLER(Fast486OpcodeLea) @@ -3921,16 +3908,14 @@
FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg) { - BOOLEAN OperandSize, AddressSize; + BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; FAST486_MOD_REG_RM ModRegRm; - - OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size; + USHORT Selector;
/* Make sure this is the right instruction */ ASSERT(Opcode == 0x8E);
TOGGLE_ADSIZE(AddressSize); - TOGGLE_OPSIZE(OperandSize);
/* Get the operands */ if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm)) @@ -3947,37 +3932,16 @@ return; }
- if (OperandSize) - { - ULONG Selector; - - if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Selector)) - { - /* Exception occurred */ - return; - } - - if (!Fast486LoadSegment(State, ModRegRm.Register, LOWORD(Selector))) - { - /* Exception occurred */ - return; - } - } - else - { - USHORT Selector; - - if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector)) - { - /* Exception occurred */ - return; - } - - if (!Fast486LoadSegment(State, ModRegRm.Register, Selector)) - { - /* Exception occurred */ - return; - } + if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector)) + { + /* Exception occurred */ + return; + } + + if (!Fast486LoadSegment(State, ModRegRm.Register, Selector)) + { + /* Exception occurred */ + return; }
if ((INT)ModRegRm.Register == FAST486_REG_SS)