mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 01:15:09 +00:00
[SOFT386]
Implement ARPL. svn path=/branches/ntvdm/; revision=60050
This commit is contained in:
parent
76b87315a8
commit
a8c1104f57
1 changed files with 39 additions and 3 deletions
|
@ -3583,10 +3583,46 @@ SOFT386_OPCODE_HANDLER(Soft386OpcodeBound)
|
||||||
|
|
||||||
SOFT386_OPCODE_HANDLER(Soft386OpcodeArpl)
|
SOFT386_OPCODE_HANDLER(Soft386OpcodeArpl)
|
||||||
{
|
{
|
||||||
// TODO: NOT IMPLEMENTED
|
USHORT FirstValue, SecondValue;
|
||||||
UNIMPLEMENTED;
|
SOFT386_MOD_REG_RM ModRegRm;
|
||||||
|
|
||||||
return FALSE;
|
if (!(State->ControlRegisters[SOFT386_REG_CR0] & SOFT386_CR0_PE)
|
||||||
|
|| State->PrefixFlags)
|
||||||
|
{
|
||||||
|
/* No prefixes allowed, protected mode only */
|
||||||
|
Soft386Exception(State, SOFT386_EXCEPTION_UD);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Get the operands */
|
||||||
|
if (!Soft386ReadModrmWordOperands(State,
|
||||||
|
&ModRegRm,
|
||||||
|
&FirstValue,
|
||||||
|
&SecondValue))
|
||||||
|
{
|
||||||
|
/* Exception occurred */
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Check if the RPL needs adjusting */
|
||||||
|
if ((SecondValue & 3) < (FirstValue & 3))
|
||||||
|
{
|
||||||
|
/* Adjust the RPL */
|
||||||
|
SecondValue &= ~3;
|
||||||
|
SecondValue |= FirstValue & 3;
|
||||||
|
|
||||||
|
/* Set ZF */
|
||||||
|
State->Flags.Zf = TRUE;
|
||||||
|
|
||||||
|
/* Write back the result */
|
||||||
|
return Soft386WriteModrmWordOperands(State, &ModRegRm, FALSE, SecondValue);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Clear ZF */
|
||||||
|
State->Flags.Zf = FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SOFT386_OPCODE_HANDLER(Soft386OpcodePushImm)
|
SOFT386_OPCODE_HANDLER(Soft386OpcodePushImm)
|
||||||
|
|
Loading…
Reference in a new issue