TAL Programmer's Guide

Mixed-Language Features of TAL
Mixed-Language Programming
096254 Tandem Computers Incorporated 17–5
PROC(32) Parameter Type Specify a procedure as a formal PROC(32) formal parameter in a TAL routine that
expects one of the following actual parameters:
A C large-memory-model routine
A FORTRAN routine compiled with the EXTENDEDREF directive
A Pascal routine
TAL Receiving PROC(32) Parameters
The following TAL routine declares a formal PROC(32) parameter::
PROC tal_proc (param_proc32);
PROC(32) param_proc32; !Formal PROC(32) parameter
BEGIN
!Lots of code
END;
The following callers can call a TAL routine that declares a formal PROC(32)
parameter:
C large-memory-model routines
COBOL85 routines
FORTRAN routines compiled with the EXTENDEDREF directive
Pascal routines
TAL routines
When a caller lists an appropriate routine in the calling sequence, the caller’s compiler
passes the routine’s 32-bit address to the TAL compiler. The high-order word of the
address contains PEP and map information; the low-order word contains a zero. If
the TAL compiler receives a 16-bit address instead, it converts the address to a 32-bit
address and passes the converted address to the called routine.
TAL Passing PROC(32) Parameters
A TAL routine can pass actual PROC(32) parameters to any of the following routines:
C large-memory-model routines
FORTRAN routines compiled with the EXTENDEDREF directive
Pascal routines
TAL routines
For each actual PROC(32) parameter, specify an EXTERNAL procedure declaration
such as:
PROC c_func (param_proc32) LANGUAGE C;
PROC(32) param_proc32; !Formal PROC(32) parameter
EXTERNAL;
Additional guidelines and examples are provided later in this section in:
“TAL Routines as Parameters to C”
“C Routines as Parameters to TAL”