TAL Programmer's Guide

Using Parameters
Using Procedures
11–22 096254 Tandem Computers Incorporated
STRING Value Parameters. Declare byte value parameters as INT simple variables where
possible because:
Passing STRING parameters by value is not portable to future software platforms.
The system places an actual STRING value in the right byte of a word as if the
value were an INT expression.
If you do declare and pass STRING value parameters, you can use the following
techniques for accessing the STRING parameter value:
The called procedure can declare a DEFINE that indexes to the parameter value:
PROC p (s);
STRING s;
BEGIN
DEFINE str = s[1]#; !Declare DEFINE STR
IF str = "A" THEN ... ; !Use STR instead of S
END;
The called procedure can left shift the parameter value by eight bits:
PROC p (s);
STRING s;
BEGIN
s := s '<<' 8; !Eight-bit left shift of value
!Lots of code
END;
The caller can left shift the parameter value in the actual parameter list by eight
bits:
CALL proc1 (byte '<<' 8);
FIXED Value Parameters. If a FIXED actual parameter has a different fpoint than the
formal parameter, the system applies the fpoint of the formal parameter to the actual
parameter.
If, however, you specify parameter type FIXED(
*
), the called procedure treats the
actual parameter as having an fpoint of 0. That is, the system copies the content of the
actual parameter to the formal parameter without an fpoint.
UNSIGNED Value Parameters. You can pass UNSIGNED parameters only as value
parameters.
Procedures as Value Parameters
You can specify procedures (but not subprocedures) as PROC or PROC(32) formal
parameters.