State->GeneralRegs[SOFT386_REG_ESP].Long = Offset;
}
+VOID
+NTAPI
+Soft386SetSegment(PSOFT386_STATE State,
+ SOFT386_SEG_REGS Segment,
+ USHORT Selector)
+{
+ /* Call the internal function */
+ Soft386LoadSegment(State, Segment, Selector);
+}
/* EOF */
VOID EmulatorSetRegister(ULONG Register, ULONG Value)
{
#ifndef NEW_EMULATOR
- if (Register < EMULATOR_REG_CS)
+ if (Register < EMULATOR_REG_ES)
{
EmulatorContext.state->general_reg[Register].val = Value;
}
else
{
- EmulatorContext.state->segment_reg[Register - EMULATOR_REG_ES].val = (WORD)Value;
+ EmulatorContext.state->segment_reg[Register - EMULATOR_REG_ES].val = (USHORT)Value;
}
#else
- // TODO: NOT IMPLEMENTED
+ if (Register < EMULATOR_REG_ES)
+ {
+ EmulatorContext.GeneralRegs[Register].Long = Value;
+ }
+ else
+ {
+ Soft386SetSegment(&EmulatorContext, Register - EMULATOR_REG_ES, (USHORT)Value);
+ }
#endif
}
}
#else
/* Dump the state for debugging purposes */
- Soft386DumpState(&EmulatorContext);
+ // Soft386DumpState(&EmulatorContext);
/* Execute the next instruction */
Soft386StepInto(&EmulatorContext);