Author: hbelusca
Date: Sun Oct 27 22:13:18 2013
New Revision: 60776
URL:
http://svn.reactos.org/svn/reactos?rev=60776&view=rev
Log:
[NTVDM]: Use SEG_OFF_TO_PTR ( $+ \epsilon * code _eorganization$ ).
Modified:
branches/ntvdm/subsystems/ntvdm/emulator.c
Modified: branches/ntvdm/subsystems/ntvdm/emulator.c
URL:
http://svn.reactos.org/svn/reactos/branches/ntvdm/subsystems/ntvdm/emulator…
==============================================================================
--- branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] (original)
+++ branches/ntvdm/subsystems/ntvdm/emulator.c [iso-8859-1] Sun Oct 27 22:13:18 2013
@@ -236,7 +236,7 @@
StackPointer = State->GeneralRegs[FAST486_REG_ESP].LowWord;
/* Get the stack */
- Stack = (LPWORD)((ULONG_PTR)BaseAddress + TO_LINEAR(StackSegment, StackPointer));
+ Stack = (LPWORD)SEG_OFF_TO_PTR(StackSegment, StackPointer);
if (BopCode == EMULATOR_INT_BOP)
{
@@ -400,21 +400,21 @@
}
}
+VOID EmulatorSetRegister(ULONG Register, ULONG Value)
+{
+ if (Register < EMULATOR_REG_ES)
+ {
+ EmulatorContext.GeneralRegs[Register].Long = Value;
+ }
+ else
+ {
+ Fast486SetSegment(&EmulatorContext, Register - EMULATOR_REG_ES,
(USHORT)Value);
+ }
+}
+
ULONG EmulatorGetProgramCounter(VOID)
{
return EmulatorContext.InstPtr.Long;
-}
-
-VOID EmulatorSetRegister(ULONG Register, ULONG Value)
-{
- if (Register < EMULATOR_REG_ES)
- {
- EmulatorContext.GeneralRegs[Register].Long = Value;
- }
- else
- {
- Fast486SetSegment(&EmulatorContext, Register - EMULATOR_REG_ES,
(USHORT)Value);
- }
}
BOOLEAN EmulatorGetFlag(ULONG Flag)