TAL Programmer's Guide
17 Mixed-Language Programming
096254 Tandem Computers Incorporated 17–1
This section gives an overview of:
Mixed-language features provided by TAL
TAL and C guidelines
CRE guidelines for TAL programs
Mixed-Language
Features of TAL
You can use the following TAL features in mixed-language programs:
NAME and BLOCK declarations
Procedure declaration LANGUAGE attribute
Procedure declaration public name
PROC and PROC(32) parameter types
Parameter pairs
ENV directive
HEAP directive
NAME and BLOCK
Declarations
All global data to be shared with routines written in other languages must be
relocatable. After binding, you should not depend on the data being located at a
particular location.
In TAL, you can use BLOCK declarations to group global data declarations into named
or private data blocks. If a BLOCK declaration is present, a NAME declaration at the
beginning of the compilation unit must name the unit. The identifiers of NAME and
BLOCK declarations must be unique among all NAME and BLOCK declarations in all
the compilation units in the program. Here is an example of a NAME declaration:
NAME input_module; !Name the compilation unit
A named data block is shareable among all compilation units in a program. You can
declare any number of named data block in a compilation unit. Here is an example of
a BLOCK declaration for a named data block (GLOBALS):
BLOCK globals; !Declare named global data block
INT .an_array[0:7];
INT .another_array[0:34];
INT(32) total;
LITERAL msg_buf = 79;
DEFINE xaddr = INT(32)#;
END BLOCK;
A private data block is shareable only among routines within the same compilation
unit. To declare a private data block, specify the PRIVATE keyword in place of the
data block identifier. You can declare only one private data block in a compilation
unit. The private data block inherits the identifier you specify in the NAME
declaration for the compilation unit. Here is an example of a BLOCK declaration for a
private data block:
BLOCK PRIVATE;
INT average;
INT total;
END BLOCK;