TAL Programmer's Guide

Using Parameters
Using Procedures
096254 Tandem Computers Incorporated 11–29
Using Reference
Parameters
A reference parameter is a formal parameter for which the caller passes the address of
a value. The called procedure can access and modify the original value in the caller’s
scope. Except in the case of definition structures, you declare formal reference
parameters as if they were simple pointers or structure pointers (by using an
indirection symbol). When you list reference parameters in the actual parameter list,
however, omit any indirection symbol.
The compiler allocates storage for parameters in the parameter area of the called
procedure or subprocedure. For reference parameters, the standard or extended
addressing mode determines the amount of space that is allocated. Table 11-5
summarizes the amount of storage the compiler allocates for formal reference
parameters:
Table 11-5. Reference Parameter Storage Allocation
Formal Parameter Parameter Type Allocation Actual Parameter
Simple pointer for
simple variable
STRING
INT
INT(32)
REAL
REAL(64)
FIXED(n)
FIXED(
*
)
Word (standard indirection) or
doubleword (extended
indirection)
Address of simple
variable
Simple pointer for
array
STRING
INT
INT(32)
REAL
REAL(64)
FIXED(n)
Word (standard indirection) or
doubleword (extended
indirection)
Address of array
Structure pointer or
indirect structure
STRING
INT
STRUCT
Word (standard indirection) or
doubleword (extended
indirection)
Address of
structure
Simple Variables as Reference Parameters
If a procedure expects a simple variable as an actual reference parameter, declare the
formal parameter as a simple pointer, preceding its identifier with an indirection
symbol.