r-----------------------------------------------------------,
A (Root Phase) I I I I I rl--------------------,<-------------Location xxxxxxi I I I I I I I IC I IB I I I yyyyyyl I ID I I I I IE I I Figure 2. An Overlay Structure
The overlay structure shown in Figure 42 could be prestructured using
the following sequence of commands (programs A, E, C, D, and E are the
names of TEXT files; the overlay phases will be named Root, Second,
Third, etc .. ): LOAD A B GENMOD ROOT (FROM A TO B STR) GENMOD SECOND (FROM B) LOAD MOD ROOT INCLUDE C D GENMOD THIRD (FROM C TO D) GENMOD FOURTH (FROM D) LOADMOD THIRD INCLUDE E GENMOD FIFTH (FROM E)
The programmer need not know the storage address where each phase
begins.. A TEXT file can be made to load at the proper address by
reloading earlier phases. In the foregoing example, the command
sequences, "LOADMOD ROOT/INCLUDE C D" and "LOADMOD THIRD/INCLUDE E," cause TEXT files C, D, and E to load at the proper addresses.
If the root phase contains address constants to the other phases, one
copy of the root must be kept in storage while each of the other phases
is brought in by the LOAD or INCLUDE commands without an intervening GENMOD. The root phase is then processed by GENMOD after all address
constants have been satisfied. In this case, the programmer must know
the address where nonroot phases begin (in Figure 41, locations xxxxxx
and yyyyyy). The following sequence of commands could be used: LOAD A B GENMOD SECOND (FROM B) INCLUDE C D (ORIGIN xxxxxx) GENMOD THIRD (FROM C TO D) GENMOD FOURTH (FROM D) INCLUDE E (ORIGIN yyyyyy) GENMOD FIFTH (FROM E) LOAD A B INCLUDE C D (ORIGIN xxxxxx) INCLUDE E (ORIGIN yyyyyy) GENMOD ROOT (FROM A TO C STR) 324 IBM VM/370 System Programmer's Guide
The ORIGIN option of the INCLUDE command is used to cause the
included file to overlay a previously loaded file. The address at which
a phase begins must be a double.ord boundary. For example, if the rcct
phase were X'2BD' bytes long, starting at virtual storage location X'20000', then location xxxxxx would be the next doubleword boundary, or X'202CO'. The STR option, which is specified in the GENMOD of the root phase,
specifies that whenever that module is brought into storage with the LOADMOD command, the Storage Initialization routine should be invoked.
This routine initializes user free storage pointers.
At execution time of the prestructured overlay program, each phase is
brought into storage with the LOADMOD command. The phases can call LOADMOD. The OS macros LINK, LOAD, and ICTL normally invoke the INCLUDE command, which loads TEXT files. These macros will invoke LOADMOD if a
switch, called COMPSWT, in the CMS Nucleus Constant area, NUCON, is
turned on. With COMPSWT set, overlay phases that use LINK, LOAD, and XCTL must be pre structured MODULE files. DYNAMIC LOAD OVERLAY The dynamic load method of using an overlay structure is to have all the
phases in the form of relocatable object code in TEXT files or of a TEXT library, filetype TXTLIB. The OS macros, LINK, LeAD, and XCTL may then be used to pass control from one phase to another. The XCTL macro causes the calling program to be overlayed by the called program
except when it is issued from the root phase. When issued from the root
phase, CMS treats XCTL as it would a LINK macro, adding the new code at
the end of the root phase.
The COMPSWT flag in OSSFLAGS must be off when the dynamic load method
is used.
Part 3. Conversational Monitor System (CMS) 325
Previous Page Next Page