TAL Programmer's Guide
Using Parameters
Using Procedures
11–24 096254 Tandem Computers Incorporated
PROC(32) Value Parameters. Specify a procedure as a formal PROC(32) parameter if the
actual parameter is the address of:
A C large-memory-model routine
A FORTRAN routine compiled with the EXTENDEDREF directive
A Pascal routine
For each actual PROC(32) parameter, the compiler allocates a doubleword of storage
in the parameter area of the called procedure. The actual PROC(32) parameter is a
32 bit address (the high-order word contains the PEP and map information of the
passed routine; the low-order word must contain a zero or a trap results). For more
information, see Section 17, “Mixed-Language Programming,”
Procedures as Parameters That Have Parameters. If a procedure declared as a formal
parameter has formal parameters of its own, you must ensure that its callers pass the
necessary actual parameters. The compiler does not provide this check. Callers must
prefix the identifier of each actual reference parameter with either:
The @ operator, which returns a standard address, either the address contained in
a pointer or the address of a nonpointer item
The $XADR standard function, which returns an extended address for a variable
that has a standard address
The following example shows use of both @ and $XADR:
PROC a (f); !Declare procedure to
STRING .EXT f; ! pass as actual parameter
BEGIN
!Lots of code
END;
PROC hi (p); !Declare procedure to call
PROC p; !Declare PROC formal parameter
BEGIN
STRING .s[0:7] := "Hi there";
CALL p ($XADR (s)); !Use $XADR
END;
PROC bye (p); !Declare procedure to call
PROC p; !Declare PROC formal parameter
BEGIN
STRING .EXT s[0:6] := "Bye bye";
CALL p (@s); !Use @ operator
END;
PROC m MAIN; !Declare caller procedure
BEGIN
CALL hi (a); !Call procedures HI and BYE
CALL bye (a); ! and pass procedure A to both
END;