qa.hlp (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
Interrupt 27H
   Summary  Notes  Back
──────────────────────────────────────────────────────────────────────────────
▀ MS-DOS then takes the following actions:
 
  ■ File buffers are flushed and any open handles for files or devices
    owned by the process are closed.
 
  ■ The termination handler vector (Int 22H) is restored from PSP:000AH.
 
  ■ The CTRL+C handler vector (Int 23H) is restored from PSP:000EH.
 
  ■ The critical-error handler vector (Int 24H) is restored from PSP:0012H.
 
  ■ Control is transferred to the termination handler.
 
▀ If the program is returning to COMMAND.COM, control transfers to the res-
  ident portion and the transient portion is reloaded if necessary. If a
  batch file is in progress, the next line of the file is fetched and in-
  terpreted; otherwise a prompt is issued for the next user command.
 
▀ This function call is typically used to allow user-written utilities,
  drivers, or interrupt handlers to be loaded as ordinary .COM or .EXE pro-
  grams, and then remain resident. Subsequent entrance to the code is via a
  hardware or software interrupt.
 
▀ This function attempts to set the initial memory allocation block to the
  length in bytes specified in register DX. If other memory blocks have
  been requested by the application via Int 21H Function 48H, they will
  not be released by this function.
 
▀ Other methods of performing a final exit are:
  - Int 20H
  - Int 21H Function 00H
  - Int 21H Function 31H
  - Int 21H Function 4CH
 
▀ This function should not be called by .EXE programs that are loaded at
  the high end of the transient program area (i.e., linked with the /HIGH
  switch) because doing so reserves the memory that is normally used by
  the transient part of COMMAND.COM. If COMMAND.COM cannot be reloaded,
  the system will fail.
 
▀ This function does not work correctly when DX contains values in the
  range  0FFF1H-0FFFFH. In this case, MS-DOS discards the high bit of the
  value in DX, resulting in the reservation of 32 KB less memory than was
  requested by the program.
 
▀ Int 21H Function 31H should be used in preference to this function be-
  cause it supports return codes, allows larger amounts of memory to be
  reserved, and does not require CS to contain the segment of the program
  segment prefix.
 
▀ [3.0+] If the program is running on a network, it should remove all
  locks it has placed on file regions before terminating.
                                    -♦-