Notes: The user termination routine is responsible for returning to the CauseWay termination routines to allow proper shutdown of the application. The instruction must be the proper 16- or 32-bit return to match the CL register setting. For ease of use with high-level languages (specifically Watcom C and setting SS back to DGROUP), [E]SI equals the internal DOS extender stack ESP immediately prior to the 32- or 16-bit call to the termination routine. If an information dump buffer address is provided, register and other termination values are placed into it using the following format:
dword EBP;
dword EDI;
dword ESI;
dword EDX;
dword ECX;
dword EBX;
dword EAX;
dword GS;
dword FS;
dword ES;
dword DS;
dword EIP;
dword CS;
dword EFLAGS;
dword ESP;
dword SS;
word TR;
dword CR0;
dword CR2;
dword CR3;
dword csAddress;
dword dsAddress;
dword esAddress;
dword fsAddress;
dword gsAddress;
dword ssAddress;
word ExceptionNumber;
dword ErrorCode;