Presented here is an overview of running an application. Many details
are omitted, but it demonstrates how all of the pieces fit together.
For simplicity, compatibility is not described here. Also, the CICS® initialization does not follow
the steps provided below; for information on CICS, see
Subsystem considerations.
- The operating system passes control to the application providing
a save area, which we term the O/S Save Area.
- Regardless of which code receives control (compiler-generated
code or runtime library), an STM into the O/S Save Area is performed
preserving the operating system's registers.
- The application (probably an HLL library routine) calls CEEINT
with R13 pointing to the O/S Save Area (and some other parameters
as well).
- While running CEEINT, Language Environment determines
the HLLs that are included in the application. For those HLLs present,
a language-specific routine (known as an EVENT handler) is loaded
and called once for process initialization, and once for enclave initialization.
This allows for language-specific initialization activities to occur.
- Upon return from CEEINT, R13 points to the Dummy (or zeroth) DSA,
R12 contains the address of the CAA, and R1 contains a pointer to
any parameters or a pointer to a list of addresses that point to any
parameters that are to be passed to the main routine.
- The HLL library routine allocates a DSA of its own and call the
main routine.
- If the user code completes through a HLL construct such as STOP
RUN, or if the main routine returns to its caller, the HLL library
routine calls the Language Environment service
CEETREC or CEETREN which terminate the enclave.
- The return code and reason code are set into R15 and R0 and returned.
- Control is returned through the save area that was passed to CEEINT
during Language Environment initialization.
That is, the registers are restored from the O/S Save Area, including
R14. Then control is returned using R14. In this example, control
is returned to the operating system.