TAL Programmer's Guide

CRE Guidelines for TAL
Mixed-Language Programming
096254 Tandem Computers Incorporated 17–37
CRE Guidelines
for TAL
The CRE provides routines that support mixed-language programs compiled on
D-series compilers. A mixed-language program can consist of C, COBOL85,
FORTRAN, Pascal, and TAL routines. By using the CRE, each routine in your
program, regardless of language, can:
Use its run-time library without overwriting the data of another run-time library
Share data in the CRE user heap
Access the standard files (standard input, standard output, and standard log)
Without the CRE, only routines written in the language of the MAIN routine can fully
access their run-time library. For example, if the MAIN routine is written in TAL, a
routine written in another language might not be able to use its own run-time library.
D-series C and Pascal routines run only in the CRE. D-series COBOL85, FORTRAN,
and TAL routines can run in the CRE if you specify the ENV COMMON directive.
Such programs must also meet CRE, system, and language requirements. The CRE
Programmer’s Guide describes CRE requirements and routines.
This section gives CRE guidelines for TAL programs. It discusses the following:
General coding guidelines
Specifying a run-time environment
Setting the user heap size
Initializing the CRE
Terminating programs
Sharing standard files
Using $RECEIVE
Handling errors in CRE math routines
General Coding Guidelines All D-series language products except TAL have run-time libraries that call CRE
routines and system routines as needed. TAL routines that meet CRE requirements
can call CRE routines (and system procedures) directly.
The following list summarizes some general guidelines for coding D-series TAL source
code for the CRE. The subsections that follow this list give more information about
some of these guidelines:
For the MAIN routine, specify the following TAL directives:
The ENV directive with the COMMON attribute to request the CRE
The HEAP directive if any routine needs the user heap in the CRE
To run in the CRE, your program needs the TALLIB and CRELIB library files.
As of the D20 release, your program can manipulate saved startup, PARAM, and
ASSIGN messages by using the Saved Messages Utility (SMU) functions provided
by the CLULIB library file.
The first statement of the MAIN routine must call TAL_CRE_INITIALIZER_. This
routine initializes the CRE and optionally saves the startup, PARAM, and ASSIGN
messages.