gtpc3m0zConcepts and Structures

Enter/Back (Program Linkage)

TPF programs are invoked through one of the following enter macros or through one of the create macros, which are described in Create Entries with Create Macros.

ENTNC -- Enter with no return. The calling program does not expect a return of control.

ENTRC -- Enter with return. The calling program expects to get control back. When a BACKC macro is encountered during Entry processing, BACKC returns control to the last program that issued an ENTRC.

ENTDC -- Enter and drop previous programs. An ECB-controlled program is invoked and the Enter/Back control information that was saved in the ECB is reinitialized to remove linkages to all previous programs.

SWISC TYPE=ENTER -- Transfer the ECB to another I-stream engine and drop previous programs. This macro performs the function of ENTDC while transferring the ECB to another I-stream engine.

When an ISO-C dynamic load module (DLM) issues external function calls, a stub is processed that provides the bridge for an ISO-C program into the TPF enter/back services. A DLM is a load module that contains multiple object files linked into 1 load module with 1 entry point.

The code expansion of the enter macro contains a unique external symbol (external in the sense of the MVS assembly process). The TPF linkage editor (LEDT) uses this external symbol to create the linkage to reach the appropriate system service routine.

TPF loaders and the system allocator manage program loading and associating program names with system storage.

The system service routine responsible for handling Enter requests:

If the program is already in main storage, the TPF system also knows where in main storage the program is located. If a program must be accessed from DASD storage, the TPF system obtains the necessary space in main storage to hold the program. This (main) storage management is transparent to the application program.

In summary, the system loader and system allocator represent the procedure that catalogs the application programs to their system residence. The mechanism that moves file-resident programs from file storage to main storage is system code that is reached as a result of an Enter macro request. BACKC implies that the entered program is returning control to a calling program. A distinction between Enter and Entry is useful:

 Entry 
A process (possibly consisting of many programs) for which a separate ECB was created. An Entry is usually created as a result of an input message. The system can also create Entries that are not the direct result of an input message.

 Enter 
The act, through the use of an Enter macro request, of invoking (transferring control to) another program. The entered (called) program will use the same ECB as the entering (calling) program. If the called program must be moved from file storage to main storage, the TPF system obtains the storage and brings about the movement. Both the entering (calling) and entered (called) programs are part of the same Entry. As programs return, main storage blocks can be released by the system through the use of the BACKC macro.

Program Nesting

Several related programs can be used to process a single message under control of a single ECB. A chain of enter-with-return requests (ENTRC macro), all under control of the same ECB, is called nesting. A program nesting area is used to bring about online program linkage that correlates the ECB to the programs that it is referencing through enter-with-return macro requests.

There is a program nesting area within the ECB to hold Enter/Back linkages. The program nesting area within the ECB is a fixed size, thereby limiting the number of programs that can be nested. At system generation time, you have the option of accepting the limitation (which is designed to be sufficient for the average application) or specifying unlimited nesting.

When an application program issues the ENTDC macro, all items in the program nesting area are cleared. ENTDC causes an ECB-controlled program segment to be invoked and all previous Enter/Back information, saved in the nesting area, is deleted from the ECB.