mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[FAST486]
When storing a segment selector, the operand size attribute is only ignored when writing to memory (where it's treated as if it's always 16-bit). svn path=/trunk/; revision=67512
This commit is contained in:
parent
9806b6c055
commit
a4901dfae5
1 changed files with 19 additions and 5 deletions
|
@ -3832,13 +3832,16 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovModrm)
|
|||
|
||||
FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg)
|
||||
{
|
||||
BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
|
||||
BOOLEAN OperandSize, AddressSize;
|
||||
FAST486_MOD_REG_RM ModRegRm;
|
||||
|
||||
/* Make sure this is the right instruction */
|
||||
ASSERT(Opcode == 0x8C);
|
||||
|
||||
OperandSize = AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
|
||||
|
||||
TOGGLE_ADSIZE(AddressSize);
|
||||
TOGGLE_OPSIZE(OperandSize);
|
||||
|
||||
/* Get the operands */
|
||||
if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
|
||||
|
@ -3854,10 +3857,21 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeMovStoreSeg)
|
|||
return;
|
||||
}
|
||||
|
||||
Fast486WriteModrmWordOperands(State,
|
||||
&ModRegRm,
|
||||
FALSE,
|
||||
State->SegmentRegs[ModRegRm.Register].Selector);
|
||||
/* When the other operand is a memory location, always use 16-bit */
|
||||
if (OperandSize && !ModRegRm.Memory)
|
||||
{
|
||||
Fast486WriteModrmDwordOperands(State,
|
||||
&ModRegRm,
|
||||
FALSE,
|
||||
State->SegmentRegs[ModRegRm.Register].Selector);
|
||||
}
|
||||
else
|
||||
{
|
||||
Fast486WriteModrmWordOperands(State,
|
||||
&ModRegRm,
|
||||
FALSE,
|
||||
State->SegmentRegs[ModRegRm.Register].Selector);
|
||||
}
|
||||
}
|
||||
|
||||
FAST486_OPCODE_HANDLER(Fast486OpcodeLea)
|
||||
|
|
Loading…
Reference in a new issue