mirror of
https://github.com/reactos/reactos.git
synced 2025-04-22 13:10:39 +00:00
[FAST486]
The segment loading/storing MOV is always 16-bit and ignores OPSIZE. svn path=/trunk/; revision=67463
This commit is contained in:
parent
f7561326df
commit
12c22c7748
1 changed files with 14 additions and 50 deletions
|
@ -3832,16 +3832,13 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovModrm)
|
||||||
|
|
||||||
FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg)
|
FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg)
|
||||||
{
|
{
|
||||||
BOOLEAN OperandSize, AddressSize;
|
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
|
||||||
FAST486_MOD_REG_RM ModRegRm;
|
FAST486_MOD_REG_RM ModRegRm;
|
||||||
|
|
||||||
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
|
|
||||||
|
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x8C);
|
ASSERT(Opcode == 0x8C);
|
||||||
|
|
||||||
TOGGLE_ADSIZE(AddressSize);
|
TOGGLE_ADSIZE(AddressSize);
|
||||||
TOGGLE_OPSIZE(OperandSize);
|
|
||||||
|
|
||||||
/* Get the operands */
|
/* Get the operands */
|
||||||
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
|
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
|
||||||
|
@ -3857,20 +3854,10 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OperandSize)
|
Fast486WriteModrmWordOperands(State,
|
||||||
{
|
&ModRegRm,
|
||||||
Fast486WriteModrmDwordOperands(State,
|
FALSE,
|
||||||
&ModRegRm,
|
State->SegmentRegs[ModRegRm.Register].Selector);
|
||||||
FALSE,
|
|
||||||
State->SegmentRegs[ModRegRm.Register].Selector);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Fast486WriteModrmWordOperands(State,
|
|
||||||
&ModRegRm,
|
|
||||||
FALSE,
|
|
||||||
State->SegmentRegs[ModRegRm.Register].Selector);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FAST486_OPCODE_HANDLER(Fast486OpcodeLea)
|
FAST486_OPCODE_HANDLER(Fast486OpcodeLea)
|
||||||
|
@ -3921,16 +3908,14 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeLea)
|
||||||
|
|
||||||
FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg)
|
FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg)
|
||||||
{
|
{
|
||||||
BOOLEAN OperandSize, AddressSize;
|
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
|
||||||
FAST486_MOD_REG_RM ModRegRm;
|
FAST486_MOD_REG_RM ModRegRm;
|
||||||
|
USHORT Selector;
|
||||||
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
|
|
||||||
|
|
||||||
/* Make sure this is the right instruction */
|
/* Make sure this is the right instruction */
|
||||||
ASSERT(Opcode == 0x8E);
|
ASSERT(Opcode == 0x8E);
|
||||||
|
|
||||||
TOGGLE_ADSIZE(AddressSize);
|
TOGGLE_ADSIZE(AddressSize);
|
||||||
TOGGLE_OPSIZE(OperandSize);
|
|
||||||
|
|
||||||
/* Get the operands */
|
/* Get the operands */
|
||||||
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
|
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
|
||||||
|
@ -3947,37 +3932,16 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovLoadSeg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (OperandSize)
|
if (!Fast486ReadModrmWordOperands(State, &ModRegRm, NULL, &Selector))
|
||||||
{
|
{
|
||||||
ULONG Selector;
|
/* Exception occurred */
|
||||||
|
return;
|
||||||
if (!Fast486ReadModrmDwordOperands(State, &ModRegRm, NULL, &Selector))
|
|
||||||
{
|
|
||||||
/* Exception occurred */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!Fast486LoadSegment(State, ModRegRm.Register, LOWORD(Selector)))
|
|
||||||
{
|
|
||||||
/* Exception occurred */
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!Fast486LoadSegment(State, ModRegRm.Register, Selector))
|
||||||
{
|
{
|
||||||
USHORT 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)
|
if ((INT)ModRegRm.Register == FAST486_REG_SS)
|
||||||
|
|
Loading…
Reference in a new issue