TAL Programmer's Guide
CRE Guidelines for TAL
Mixed-Language Programming
096254 Tandem Computers Incorporated 17–39
Specifying a Run-Time
Environment
To specify the intended run-time environment of a D-series TAL compilation unit, use
the ENV directive. To execute in the intended environment, the routines must also
meet the requirements of the intended run-time environment.
The attributes of the ENV directive are:
ENV Attribute Intended Run-Time Environment
COMMON The CRE.
OLD A COBOL or FORTRAN run-time environment outside the CRE.
NEUTRAL None; the program relies primarily on system procedures.
You can include the ENV directive in the TAL compilation command or in the
compilation unit before any declarations. The ENV directive can appear only once
during a compilation.
For example, you can specify ENV on a directive line and include the COMMON
attribute:
?ENV COMMON
If you compile without the ENV directive, all routines in the compilation unit have the
ENV NEUTRAL attribute.
ENV COMMON Directive
An object file can run in the CRE if the MAIN routine has the ENV COMMON
attribute and if all routines meet CRE requirements. If ENV COMMON is in effect, all
routines in the compilation unit (except routines in object files listed in SEARCH
directives) have the ENV COMMON attribute.
SEARCH directives can list object files compiled with any ENV attribute except OLD.
Each routine in a SEARCH file retains its original ENV attribute.
When a compilation unit contains a MAIN routine and ENV COMMON is in effect,
the compiler allocates special CRE data blocks and initializes certain fields of those
data blocks. These data blocks, listed in Table 17-3, are reserved for use by the CRE.
Table 17-3. CRE Data Blocks
Data Block Name Location
Basic control block #CRE_GLOBALS At G[0] and G[1] of the user data segment.
Master control block #MCB In the upper 32K-word area of the user data
segment.
CRE heap #CRE_HEAP Last block in the upper 32K-word area of the user
data segment. (This heap differs from the CRE
user heap block named #HEAP.)
Using Binder, you can bind an object file compiled with ENV COMMON to any object
file except those compiled with ENV OLD. Each routine in the new object file retains
its original ENV attribute.