Chapter
1
I
System
Calls
System
Call
Descriptions
Many system calls require that parameters be loaded into
1
or
more registers before the call is issued; this information is given
under Entry Conditions in the individual system call descrip-
tions. Most calls return information in the registers, as given
under Exit Conditions and Error Returns.
For
some
of
the system calls, a macro is defined and used in the
example
for
that call. All macro definitions are listed at the end
of
the chapter, together with an extended example that illus-
trates the system calls.
The examples are not intended to represent good programming
practice. Error checking and user friendliness have been sacri-
ficed
to
conserve space. Many
of
the examples are not usable as
stand-alone programs but merely show you how
to
get started
with this command. You may, however, find the macros a conve-
nient way
to
include system calls in your assembly language
programs.
Interrupts
MS-DOS reserves Interrupts
20H
through
3FH
for
its own use.
Memory locations
80H
to FCH are reserved
for
the table
of
inter-
rupt routine addresses (vectors).
To set an interrupt vector, use Function Call
25H.
To retrieve
the contents
of
a vector, use Function Call
35H.
Do not write or
read vectors directly
to
or
from the vector table.
List
of
MS-DOS Interrupts
Interrupt Description
Hex Dec
20H
2 1H
22H
23H
24H
25H
26H
27H
32
Program terminate
33
Function request
34
Terminate address
35
CONTROL-C exit address
36
Fatal error abort address
37
Absolute disk read
38
Absolute disk write
39
Terminate but stay resident
12