15.2 How to Create an Overlaid Program

To create a program that uses overlays, first decide how you want to organize your code. All code not explicitly or implicitly assigned to an overlay is placed in the root. You can use both compiler and linker features to specify the organization of your code. MOVE uses a module-definition (.DEF) file to describe overlays.

LINK automatically creates an overlaid DOS program when you provide a module-definition file in which a SEGMENTS or FUNCTIONS statement specifies an overlay number. (LINK also creates an overlaid program when it detects parentheses in the objects field on the command line; see “Dynamic and Static Overlays”.)

The sections that follow describe overlay-related compiler features, module-definition statements, and LINK options.