Microsoft KB Archive/38958

Differences between Segmentation and Overlays in COBOL 3.0

PSS ID Number: Q38958 Article last modified on 04-20-1993

3.00 3.00a | 3.00 3.00a MS-DOS | OS/2

Summary: This information below describes the difference between segmentation overlays and LINK overlays with regard to Microsoft COBOL. Microsoft COBOL Versions 3.0 and 3.0a support only segmentation overlays. LINK overlays are not recommended or supported. Microsoft COBOL Versions 1.1, 1.12, 2.0, 2.1, and 2.2 support segmentation overlays. LINK overlays are not supported in these COBOL versions (1.x and 2.x). Note that COBOL Versions 2.x don’t have a LINK step, since programs are compiled into a pseudo-code that is executed with RUNCOB.EXE, the run-time executer.

More Information: A segmentation-overlayed program is written as one source file. The SECTION statement defines segments in the PROCEDURE DIVISION, and these segments are invoked with the PERFORM statement. The COBOL 3.0 or 3.0a compiler outputs separate object modules for the segments, and the linker combines them into one executable .EXE program. In LINK-overlayed programs, the overlays are created from separate subprogram source files that are compiled into separate object modules. A subprogram in a LINK overlay is invoked with the CALL statement. Special linker commands arrange the separate object files as subprogram overlays located in one executable (.EXE) disk file. Microsoft does not test, guarantee, or support the use of LINK overlays with Microsoft COBOL Version 3.0 or 3.0a. Customers should not depend upon LINK overlays. Instead of using LINK overlays (invoked with the CALL statement), COBOL programmers should use segmentation overlays. For an example of segmentation, search for the following words: segmentation and SECTION and 49 and COBOL Segmentation provides the same functionality as LINK overlays.

Segment-Overlayed    LINK-Overlayed Programs (Supported) Programs (Not Supported) Programming Must define Code in the program considerations segmentable is overlayable, but sections in the data is not. PROCEDURE DIVISION. What is PROCEDURE Code in the program segmentable or DIVISION only. is overlayable, but overlayable? data is not. Logic Fixed segments Root overlay stays in considerations remain in memory. memory. Overlays cannot Independent call each other. segments can be swapped. Necessary SEG LITLINK Compiler Directives Documentation “Microsoft COBOL”Microsoft COBOL Utilities&quot; Compiler Version manual for Version 3.0/3.0a, 3.0: Operating Pages 41 and 42 for LINKer Guide,&quot; Page 4-6. overlay information. “Microsoft COBOL NOTE: LINK overlays are not Compiler Version tested or supported with 3.0: Language COBOL 3.0/3.0a. Reference Manual,” Chapter 7.

Additional reference words: 3.00 3.00a Copyright Microsoft Corporation 1993.