Function 00h Terminate Program

mov ah, 00h ;Terminate Program

int 21h

Terminate Program (Function 00h) terminates the current program and returns control to its parent program.

This function has been superseded by End Program (Function 4Ch).

Parameters

This function has no parameters.

Return Value

This function does not return.

Comments

This function is intended to be used by .COM programs. When a program calls this function, the CS register must contain the segment address of the program segment prefix (PSP).

This function carries out the following actions:

Flushes the file buffers and closes files, unlocking any regions locked by the program.

Restores Termination Address (Interrupt 22h) from offset 0Ah in the PSP (pspTerminateVector field).

Restores the address of CTRL+C Handler (Interrupt 23h) from offset 0Eh in the PSP (pspControlCVector field).

Restores the address of Critical-Error Handler (Interrupt 24h) from offset 12h in the PSP (pspCritErrorVector field).

Frees any memory owned by the terminating process.

After completing these actions, this function transfers control to the address specified by offset 0Ah in the PSP.

See Also

Interrupt 20h Terminate Program
Interrupt 22h Termination Address
Interrupt 23h CTRL+C Handler
Interrupt 24h Critical-Error Handler
Function 4Ch End Program