TAL Programmer's Guide

Parameter Masks
Using Procedures
096254 Tandem Computers Incorporated 11–41
VARIABLE Doubleword Parameter Mask
If a VARIABLE procedure has more than 16 parameters, the compiler generates a
doubleword mask. It allocates the high-order word of the mask in location L[–4] and
the low-order word of the mask in location L[–3].
The compiler associates each formal parameter with a bit in the mask, right-justifying
the layout so the last formal parameter corresponds to bit <15> of the low-order word.
In the following example, PROC_B has 18 formal parameters. Procedure B_CALLER
calls PROC_B and passes five parameters to it:
PROC proc_b (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r) VARIABLE;
INT a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;
BEGIN
!Process the parameter values
END;
PROC b_caller;
BEGIN
INT aa, dd, ee, ff, jj;
!Lots of code
CALL proc_b (aa,!bb!,!cc!,dd,ee,ff,!gg!,!hh!,!ii!,jj);
!Pass AA, DD, EE, FF, and JJ
! (comments denote omitted
END; ! parameters)
Figure 11-5 shows the doubleword parameter mask for the preceding example. In this
case, bits <0:13> in the high-order word 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-5. VARIABLE Doubleword Parameter Mask
L [-4]:
Actual parameters:
Formal parameters:
0 000000000000010
0123456789101112131415
AA
AB
L [-3]:
Actual parameters:
Formal parameters:
0 111000100000000
C
DD
D
EE
E
FF
FGH I
JJ
JKLMNOPQR
340