TAL Programmer's Guide

Parameter Masks
Using Procedures
11–38 096254 Tandem Computers Incorporated
Parameter Masks When a procedure calls a VARIABLE or EXTENSIBLE procedure, the compiler
provides a parameter mask and keeps track of which actual parameters are passed to
the procedure.
When a procedure calls a VARIABLE or EXTENSIBLE procedure that is declared as a
formal parameter, however, the compiler does not provide a parameter mask. The
caller must provide the parameter mask as part of the CALL statement. For an
example, see “Procedures as Value Parameters” earlier in this section.
The following subsections describe how the compiler formats and allocates
VARIABLE and EXTENSIBLE parameter masks for the TNS system. (The format of
VARIABLE masks differ from that of EXTENSIBLE masks.)
VARIABLE
Parameter Masks
When a VARIABLE procedure is called, the compiler:
1. Allocates storage for each formal parameter in the called procedure’s parameter
area
2. Generates one of the following parameter masks:
A one-word mask for 16 or fewer formal parameters
A doubleword mask for 17 or more parameters
3. Initializes the mask bits to 0
4. Allocates storage for the parameter mask in the called procedure’s parameter area
as follows:
One-word mask—at location L[–3]
Doubleword mask—at location L[–3] for the low-order word and L[–4] for the
high-order word
5. Associates each formal parameter with a bit in the parameter mask, right justifying
the layout in the mask, so the last parameter corresponds to bit <15> of the low-
order word
6. Sets the bit for each passed parameter to 1