TAL Programmer's Guide
Parameter Masks
Using Procedures
11–44 096254 Tandem Computers Incorporated
EXTENSIBLE Doubleword Parameter Mask
If an EXTENSIBLE procedure has more than 16 (but less than 33) parameter words, the
compiler generates a doubleword mask. It associates each word of each formal
parameter with a bit in the mask, left justifying the layout so the first parameter word
corresponds to bit <0> of the low-order word.
In the following example, PROC_D has 12 formal parameters of varying lengths.
Procedure D_CALLER calls PROC_D and passes five actual parameters, totaling nine
parameter words.
PROC proc_d (a,b,c,d,e,f,g,h,i,j,k,l) EXTENSIBLE;
INT a,d,f,g,k,l;
INT(32) b,e,h,i,j;
FIXED c;
BEGIN
!Do more work
END;
PROC d_caller;
BEGIN
INT aa, ff, gg;
FIXED cc;
INT(32) jj;
!Do some work
CALL proc_d (aa,,cc,,,ff,gg,,,jj);
END;
Figure 11-7 shows the parameter mask settings for the preceding example. In this
case, bits <4:15> of the high-order word (L[–5]) 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-7. EXTENSIBLE Doubleword Parameter Mask
L [-5]:
Actual parameters:
Formal parameters:
L [-4]:
Actual parameters:
Formal parameters:
342
1 100000000000000
0123456789101112131415
JJ
JKL
1001111000110000
AA
AB
CC
CDE
FF
F
GG
GH I
The compiler stores the number of passed parameter words (in its negative form) at
location L[–3]. For the preceding example, the value stored is –9.