Function 4Ch            End Program (EXIT)

Terminates the current program and returns control to its parent
program.

Entry AH = 4Ch
AL = Return value

Return This function does not return

─────────────────────────────────────────────────────────────────

This function performs the following actions:

- Flushes the file buffers and closes files, unlocking any regions
locked by the program.
- Restores interrupt 22h, 23h, and 24h vectors from the addresses
saved in the PSP.
- Frees any memory owned by the terminating program.
- Transfers control to the address specified by offset 0Ah
(termination address) in the PSP (usually COMMAND.COM).


The return value may be retrieved (using function 4dh) by a parent
process that was started by function 4b00h, or tested by means of
the errorlevel feature of DOS batch processing. If the program
terminates normally, the return value should be 00h.