mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 08:13:01 +00:00
[FAST486]
- Control register 0 is CR0: use FAST486_REG_CR0 instead of 0, as it is done in the rest of the code. - Improve a if/else if control. - Don't halt the processor in the middle of prefixes processing. svn path=/trunk/; revision=64851
This commit is contained in:
parent
e46ceff760
commit
705dcd2d05
5 changed files with 6 additions and 14 deletions
|
@ -55,7 +55,7 @@ Fast486ReadMemory(PFAST486_STATE State,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for protected mode */
|
/* Check for protected mode */
|
||||||
if (State->ControlRegisters[0] & FAST486_CR0_PE)
|
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
||||||
{
|
{
|
||||||
/* Privilege checks */
|
/* Privilege checks */
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ Fast486WriteMemory(PFAST486_STATE State,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check for protected mode */
|
/* Check for protected mode */
|
||||||
if (State->ControlRegisters[0] & FAST486_CR0_PE)
|
if (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE)
|
||||||
{
|
{
|
||||||
/* Privilege checks */
|
/* Privilege checks */
|
||||||
|
|
||||||
|
|
|
@ -762,7 +762,7 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
ModRegRm->Register = (ModRmByte >> 3) & 0x07;
|
ModRegRm->Register = (ModRmByte >> 3) & 0x07;
|
||||||
|
|
||||||
/* Check the mode */
|
/* Check the mode */
|
||||||
if ((ModRmByte >> 6) == 3)
|
if (Mode == 3)
|
||||||
{
|
{
|
||||||
/* The second operand is also a register */
|
/* The second operand is also a register */
|
||||||
ModRegRm->Memory = FALSE;
|
ModRegRm->Memory = FALSE;
|
||||||
|
@ -886,7 +886,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
/* [BX + SI] */
|
/* [BX + SI] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBX].LowWord
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBX].LowWord
|
||||||
+ State->GeneralRegs[FAST486_REG_ESI].LowWord;
|
+ State->GeneralRegs[FAST486_REG_ESI].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -895,7 +894,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
/* [BX + DI] */
|
/* [BX + DI] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBX].LowWord
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBX].LowWord
|
||||||
+ State->GeneralRegs[FAST486_REG_EDI].LowWord;
|
+ State->GeneralRegs[FAST486_REG_EDI].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,7 +902,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
/* SS:[BP + SI] */
|
/* SS:[BP + SI] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBP].LowWord
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBP].LowWord
|
||||||
+ State->GeneralRegs[FAST486_REG_ESI].LowWord;
|
+ State->GeneralRegs[FAST486_REG_ESI].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -913,7 +910,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
/* SS:[BP + DI] */
|
/* SS:[BP + DI] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBP].LowWord
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBP].LowWord
|
||||||
+ State->GeneralRegs[FAST486_REG_EDI].LowWord;
|
+ State->GeneralRegs[FAST486_REG_EDI].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -921,7 +917,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
{
|
{
|
||||||
/* [SI] */
|
/* [SI] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_ESI].LowWord;
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_ESI].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -929,7 +924,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
{
|
{
|
||||||
/* [DI] */
|
/* [DI] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EDI].LowWord;
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EDI].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -953,7 +947,6 @@ Fast486ParseModRegRm(PFAST486_STATE State,
|
||||||
{
|
{
|
||||||
/* [BX] */
|
/* [BX] */
|
||||||
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBX].LowWord;
|
ModRegRm->MemoryAddress = State->GeneralRegs[FAST486_REG_EBX].LowWord;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ Fast486DumpState(PFAST486_STATE State)
|
||||||
{
|
{
|
||||||
DbgPrint("\nFast486DumpState -->\n");
|
DbgPrint("\nFast486DumpState -->\n");
|
||||||
DbgPrint("\nCPU currently executing in %s mode at %04X:%08X\n",
|
DbgPrint("\nCPU currently executing in %s mode at %04X:%08X\n",
|
||||||
(State->ControlRegisters[0] & FAST486_CR0_PE) ? "protected" : "real",
|
(State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_PE) ? "protected" : "real",
|
||||||
State->SegmentRegs[FAST486_REG_CS].Selector,
|
State->SegmentRegs[FAST486_REG_CS].Selector,
|
||||||
State->InstPtr.Long);
|
State->InstPtr.Long);
|
||||||
DbgPrint("\nGeneral purpose registers:\n"
|
DbgPrint("\nGeneral purpose registers:\n"
|
||||||
|
|
|
@ -54,9 +54,9 @@ Fast486ExecutionControl(PFAST486_STATE State, FAST486_EXEC_CMD Command)
|
||||||
/* Main execution loop */
|
/* Main execution loop */
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
NextInst:
|
|
||||||
if (!State->Halted)
|
if (!State->Halted)
|
||||||
{
|
{
|
||||||
|
NextInst:
|
||||||
/* Check if this is a new instruction */
|
/* Check if this is a new instruction */
|
||||||
if (State->PrefixFlags == 0) State->SavedInstPtr = State->InstPtr;
|
if (State->PrefixFlags == 0) State->SavedInstPtr = State->InstPtr;
|
||||||
|
|
||||||
|
|
|
@ -4985,8 +4985,7 @@ FAST486_OPCODE_HANDLER(Fast486OpcodeLoop)
|
||||||
/* Additional rule for LOOPNZ */
|
/* Additional rule for LOOPNZ */
|
||||||
if (State->Flags.Zf) Condition = FALSE;
|
if (State->Flags.Zf) Condition = FALSE;
|
||||||
}
|
}
|
||||||
|
else if (Opcode == 0xE1)
|
||||||
if (Opcode == 0xE1)
|
|
||||||
{
|
{
|
||||||
/* Additional rule for LOOPZ */
|
/* Additional rule for LOOPZ */
|
||||||
if (!State->Flags.Zf) Condition = FALSE;
|
if (!State->Flags.Zf) Condition = FALSE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue