TAL Programmer's Guide
Parameter Masks
Using Procedures
096254 Tandem Computers Incorporated 11–39
VARIABLE Word Parameter Mask
If a VARIABLE procedure has 16 or fewer formal parameters, the compiler generates a
one-word mask. It associates each formal parameter with a bit in the mask, right
justifying the layout so the last parameter corresponds to bit <15>.
In the following example, PROC_A has six formal parameters. Procedure A_CALLER
calls PROC_A and passes three actual parameters to it. Each empty comma in the
actual parameter list denotes an omitted parameter, regardless of size:
PROC proc_a (p1,p2,p3,p4,p5,p6) VARIABLE;
INT p1,p2,p3,p4,p5,p6;
BEGIN
!Process the parameter values
END;
PROC a_caller MAIN;
BEGIN
INT x, y, z;
!Process the variables
CALL proc_a (,x,y,,z); !Call PROC_A; pass three
! parameters (each empty comma
END; ! denotes an omitted parameter)
Figure 11-3 shows the parameter mask for the preceding example. In this case, bits
<0:9> are not used and contain zeros. Bits corresponding to passed parameters each
show a 1, while bits corresponding to omitted parameters each show a 0.
Figure 11-3. VARIABLE Word Parameter Mask
L [-3]:
Actual parameters:
Formal parameters:
0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0
0123456789101112131415
P1
X
P2
Y
P3 P4
Z
P5 P6
339