PDOS_REGISTER_STATE State;
WORD StackPointer = getSP();
+#ifdef ADVANCED_DEBUGGING
DPRINT1("\n"
"DosSaveState(before) -- SS:SP == %04X:%04X\n"
"Original CPU State =\n"
getSS(), getSP(),
getDS(), getES(), getAX(), getCX(),
getDX(), getBX(), getBP(), getSI(), getDI());
+#endif
/*
* Allocate stack space for the registers. Note that we
State->SI = getSI();
State->DI = getDI();
+#ifdef ADVANCED_DEBUGGING
DPRINT1("\n"
"DosSaveState(after) -- SS:SP == %04X:%04X\n"
"Saved State =\n"
getSS(), getSP(),
State->DS, State->ES, State->AX, State->CX,
State->DX, State->BX, State->BP, State->SI, State->DI);
+#endif
}
static inline VOID DosRestoreState(VOID)
*/
State = SEG_OFF_TO_PTR(getSS(), getSP());
+#ifdef ADVANCED_DEBUGGING
DPRINT1("\n"
"DosRestoreState(before) -- SS:SP == %04X:%04X\n"
"Saved State =\n"
getSS(), getSP(),
State->DS, State->ES, State->AX, State->CX,
State->DX, State->BX, State->BP, State->SI, State->DI);
+#endif
setSP(getSP() + sizeof(DOS_REGISTER_STATE) - sizeof(WORD));
setSI(State->SI);
setDI(State->DI);
+#ifdef ADVANCED_DEBUGGING
DPRINT1("\n"
"DosRestoreState(after) -- SS:SP == %04X:%04X\n"
"Restored CPU State =\n"
getSS(), getSP(),
getDS(), getES(), getAX(), getCX(),
getDX(), getBX(), getBP(), getSI(), getDI());
+#endif
}
static WORD DosCopyEnvironmentBlock(IN LPCSTR Environment OPTIONAL,
/* Push the task state */
DosSaveState();
+#ifdef ADVANCED_DEBUGGING
DPRINT1("Sda->CurrentPsp = 0x%04x; Old LastStack = 0x%08x, New LastStack = 0x%08x\n",
Sda->CurrentPsp, SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack, MAKELONG(getSP(), getSS()));
+#endif
/* Update the last stack in the PSP */
SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack = MAKELONG(getSP(), getSS());
TerminationType = (KeepResident != 0 ? 0x03 : 0x00);
Sda->ErrorLevel = MAKEWORD(ReturnCode, TerminationType);
+#ifdef ADVANCED_DEBUGGING
DPRINT1("PspBlock->ParentPsp = 0x%04x; Sda->CurrentPsp = 0x%04x\n",
PspBlock->ParentPsp, Sda->CurrentPsp);
+#endif
if (Sda->CurrentPsp != SYSTEM_PSP)
{
+#ifdef ADVANCED_DEBUGGING
DPRINT1("Sda->CurrentPsp = 0x%04x; Old SS:SP = %04X:%04X going to be LastStack = 0x%08x\n",
Sda->CurrentPsp, getSS(), getSP(), SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack);
+#endif
/* Restore the parent's stack */
setSS(HIWORD(SEGMENT_TO_PSP(Sda->CurrentPsp)->LastStack));