| |
Interrupt 20h PROGRAM TERMINATE
Input |
DOS1 |
Y |
DOS2 |
Y |
DOS3 |
Y |
DOS5 |
Y |
Output |
AX |
|
|
|
|
AX |
BX |
|
|
|
|
BX |
CX |
|
|
|
|
CX |
DX |
|
|
|
|
DX |
ES:DI |
|
|
CF |
Important: Before you issue an interrupt 20h, your program must
ensure that the CS register contains the segment of its program
segment prefix.
Issue int 20h to exit from a program. This vector transfers to
the logic in DOS to restore the terminate address, the Ctrl-Break
address,and the critical error exit address to the values they
had on entry to the program. All the file buffers are flushed and
all handles are closed. You should close all files changed in
length (see function calls 10h and 3Eh) before issuing this
interrupt. If the changed file is not closed, its length, time,
and date are not recorded correctly in the directory.
For a program to pass a completion code or an error code when
terminating, it must use either function call 4Ch (Terminate a
Process) or 31h (Terminate Process and Stay Resident). These two
methods are preferred over using int 20h and the codes returned
by them can be interrogated in batch processing.
See Also Func/00h Func/4Ch |