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.
Using Overlays
◄Up► ◄Contents► ◄Index► ◄Back►
─────Using Overlays─────────────────────────────────────────────────────────
LINK can create DOS programs with overlays. Overlays are parts of
a program that are loaded into memory only when needed. Overlays
share the same space in memory.
Specifying Overlays
Specify overlays by grouping object files in parentheses.
See: ◄Overlay Syntax►
How Overlays Work
The overlay-manager code is included as part of the language's
default libraries. If you specify overlays during linking, the
code for the overlay manager is automatically linked with the rest
of your program. LINK produces only one .EXE file. This file is
read again and again as long as the overlay manager needs to
extract overlaid object files. When a program cannot find a needed
file containing an overlay, it generates prompts.
See: ◄Overlay-Manager Prompts►
Only code is overlaid, not data. Programs that use overlays
usually require less memory. However, they run more slowly because
of the time needed to load and reload the code from disk into
memory. Not all programs can use overlays.
See: ◄Restrictions on Overlays►
Overlay Interrupts
LINK replaces far calls to routines in overlays with interrupts
(followed by the module identifier and offset). By default, the
interrupt number is 63 (3F hexadecimal). Use the /OV option to
change the interrupt number.
See: ◄/OV Option►
WARNING: Never rename an executable program file containing
overlays if it is to run under DOS 2.x and earlier. LINK
records the .EXE filename in the program file. If you
rename the file, the overlay manager may not be able to
locate the proper file. You can rename an .EXE file that
will run under DOS 3.x and later.
-♦-