[SOFT386]

Implement external stack modification.
[NTVDM]
Implement EmulatorSetStack for NEW_EMULATOR.


svn path=/branches/ntvdm/; revision=60257
This commit is contained in:
Aleksandar Andrejevic 2013-09-21 00:41:41 +00:00
parent 34157419d7
commit 7328873681
3 changed files with 21 additions and 1 deletions

View file

@ -341,6 +341,10 @@ VOID
NTAPI
Soft386ExecuteAt(PSOFT386_STATE State, USHORT Segment, ULONG Offset);
VOID
NTAPI
Soft386SetStack(PSOFT386_STATE State, USHORT Segment, ULONG Offset);
#endif // _SOFT386_H_
/* EOF */

View file

@ -270,4 +270,20 @@ Soft386ExecuteAt(PSOFT386_STATE State, USHORT Segment, ULONG Offset)
State->InstPtr.Long = Offset;
}
VOID
NTAPI
Soft386SetStack(PSOFT386_STATE State, USHORT Segment, ULONG Offset)
{
/* Load the new SS */
if (!Soft386LoadSegment(State, SOFT386_REG_SS, Segment))
{
/* An exception occurred, let the handler execute instead */
return;
}
/* Set the new SP */
State->GeneralRegs[SOFT386_REG_ESP].Long = Offset;
}
/* EOF */

View file

@ -429,7 +429,7 @@ VOID EmulatorSetStack(WORD Segment, DWORD Offset)
/* Call the softx86 API */
softx86_set_stack_ptr(&EmulatorContext, Segment, Offset);
#else
// TODO: NOT IMPLEMENTED
Soft386SetStack(&EmulatorContext, Segment, Offset);
#endif
}