Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- DOS 5.0 Ref. - <b>function 4ch end program (exit)</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
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.

See Also: 31h 4dh 5ch 4b00h PSP

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson