LINK Help (linker.hlp) (Table of Contents; Topic list)
Creating a .DEF File for Overlays
                                             Up Contents Index Back
─────LINK───────────────────────────────────────────────────────────────────
 
     To specify the organization of your overlaid program, write a
     module-definition (.DEF) file. Valid statements in a .DEF file for
     an overlaid program are SEGMENTS, FUNCTIONS, and INCLUDE. LINK
     ignores other statements when linking an overlaid DOS program.
 
     See: Module-Definition Files
          FUNCTIONS Statement
          SEGMENTS Statement
          INCLUDE Statement
 
     The FUNCTIONS and SEGMENTS Statements
 
     The FUNCTIONS and SEGMENTS statements place code in overlays.
     Valid overlay numbers are in the range 1-65,535. To place code in
     the root, specify 0. Use FUNCTIONS and SEGMENTS as follows:
 
        ■ To place an entire segment into an overlay, use a SEGMENTS
          statement specified with an overlay number.
 
        ■ To place a function into an overlay, use a FUNCTIONS
          statement specified with an overlay number. The function must
          be compiled as a packaged function. If a function is
          explicitly allocated, it cannot be assigned to a different
          overlay from the segment that contains the function.
 
        ■ To place a function into a segment and then place the segment
          into an overlay, use a FUNCTIONS statement specified with a
          segment name and a SEGMENTS statement specified with the
          segment name and an overlay number. The function must be
          compiled as a packaged function. An explicitly allocated
          function cannot be assigned to a segment different from the
          one to which it was allocated.
 
        ■ To assign an explicitly allocated function to an overlay, use
          a FUNCTIONS statement specified with an overlay number, and
          do not assign its segment or any other functions in that
          segment to an overlay. A FUNCTIONS statement that specifies
          an explicitly allocated function implicitly assigns that
          function's entire segment to the overlay.
 
     The INCLUDE Statement
 
     The INCLUDE statement inserts a specified text file at the place
     where it is specified in a .DEF file. The INCLUDE statement
     behaves the same way in .DEF files for all program types.
                                    -♦-