Chapter
1
I
System
Calls
Terminate But Stay Resident
Interrupt
27H
Used
to
make a piece
of
code remain resident in the sys-
tem after its termination. This call is typically used in
.COM
files
to
allow some device-specific interrupt handler
to
remain resident to process asynchronous interrupts.
When Interrupt
27H
is executed, the program terminates
but is treated as an extension
of
MS-DOS.
It remains res-
ident and is not overlaid by other programs when it
terminates.
This interrupt provides compatibility with earlier versions
of
MS-DOS.
New programs should use the function
31H,
Keep Process.
Entry Conditions:
CS:DX
=
first byte following last byte of
code
in the
Macro
Definition:
program
stay-resident macro last-instruc
mov dx,offset last-instruc
inc dx
int
27H
endm
Example:
;CS
must be equal
to
PSP
value5 given
at
program start
;(ES
and DS values)
rnov DX,LastAddress
int
27H
;There is no return from this interrupt
24