Microsoft LINK utility automatically creates an overlay program when overlays are specified in the link command. Overlays are program segments that can be loaded into memory only as needed. This allows a DOS program which would require a large amount of memory to execute in a much smaller memory space. An overlay program consists of two parts, a root and the overlay. The root is the portion of code that always stays resident during program execution.
Overlay code is the portion of code that can be loaded into or discarded from memory as needed.
Code that resides in the same code segment as well as individual functions can be placed in an overlay, except callbacks and functions that are indirectly referenced by others via function addresses, such as function dispatch tables used in the NetSentinel code. Microsoft LINK utility automatically creates an overlay program when overlays are specified in the link command. To run the overlay object modules in different overlays, rearrange the overlay numbers to use any number between 1 and 65535. A overlay number groups a set of functions or code segments in an overlay. Overlay number 0 is reserved for code to be placed in root.