COBOL Manual for TNS and TNS/R Programs
Program Compilation
HP COBOL Manual for TNS and TNS/R Programs—522555-006
11-60
COMPACT and NOCOMPACT
COMPACT and NOCOMPACT
COMPACT
causes BINSERV to attempt to compact the code space of the target file.
NOCOMPACT
prevents BINSERV from compacting the code space of the target file.
Compacting the target file also decreases the space required by the executing
program.
Memory consists of a data area and a code area. COMPACT affects only the code
area.
The object code HP compilers produce is composed of blocks. Code-space blocks
(code blocks and read-only arrays) can never span from one code segment to another,
so they can never exceed a size of 128 KB. Object code for an HP COBOL routine can
straddle a 64 KB boundary only when a block exceeds 64 KB. A code-space block can
be as large as 126,998 bytes, leaving 1002 bytes for the procedure entry point (PEP)
table and the external entry point (XEP) table. Object code for routines written in other
languages cannot straddle the 64 KB boundary in a 128 KB code segment.
If you specify NOCOMPACT, BINSERV allocates code-space blocks strictly in the
order in which they are presented by the compiler. This can leave gaps between the
64 KB boundary and the last code-space block below it, and between the 128 KB
boundary and the last code-space block below it.
If you specify only COMPACT, or omit both COMPACT and NOCOMPACT, BINSERV
checks each succeeding code-space block to determine whether it will fit into either
current gap. When a code-space block that fits in a gap is found, BINSERV allocates it
in the gap, thereby compressing both the target file and the object program.
Note. The NMCOBOL compiler, which does not use BINSERV, issues warnings for these
directives.
Default: COMPACT
Placement: Anywhere
Scope: The last COMPACT or NOCOMPACT in the compilation unit applies.
Dependencies: None
COMPACT
NOCOMPACT
VST271.vsd