Chapter
1
I
System
Calls
Exec
Load and Execute a Program Function Call
4BH
Lets
a
program load another program into memory and option-
ally begin execution
of
the second program.
A
function code is passed in AL:
0
-
Load and execute the program. A Program Seg-
ment Prefix is established
for
the program and
the terminate and CONTROL-C addresses are set
to
the instruction after the Exec function call.
3
-
Load the program, do not create the program
segment prefix, and do not begin execution. This
is
useful in loading program overlays.
For each value
of
AL, the parameter block pointed
to
by
ES:BX has the following format:
AL
=
0 Load and execute program
WORD segment address
of
environment string
DWORD pointer
to
command line
to
be placed at
PSP
+
80H
DWORD pointer
to
default FCB
to
be passed at
PSP
+
5CH
DWORD pointer to default FCB
to
be passed
at
PSP
+
6CH
AL
=
3
Load overlay
WORD segment address where file will be loaded
I
WORD relocation factor
to
be applied
to
the image
For function AL
=
0, there must be enough free memory
for
MS-DOS
to
load the program. For function AL
=
3,
it is assumed that the program doing the loading will
load the overlay into its own memory space,
so
no free
memory is needed.
126