pTAL Reference Manual (H06.08+)

Procedures, Subprocedures, and Procedure
Pointers
HP pTAL Reference Manual523746-006
14-16
Using STRUCT as a Formal Parameter
Using STRUCT as a Formal Parameter
You cannot declare a definition STRUCT as a formal parameter. You can, however,
achieve the same effect by using a referral STRUCT as a formal parameter, and
having it reference a previously declared structure.
Passing an .EXT Parameter to a Non-EXTENDED Reference
Parameter
You can pass a variable declared with a .EXT indirection symbol to a formal parameter
declared with a . indirection symbol. pTAL converts the extended address to a
BADDR or WADDR, as appropriate. In the following example, pTAL converts the
extended address of I to a WADDR address:
INT .EXT i;
PROC p(a);
INT .a;
BEGIN
...
END;
p(i);
Using the PROC Formal Parameter
The @ character is not allowed on the actual parameter if the formal parameter is a
PROC.
Referencing Parameters
Do not depend on the order in which parameters are allocated in memory. You must
refer to each parameter only as a named entity. Do not refer to one parameter as a
base off of which you reference other parameters.
Example 14-5. Using a Referral STRUCT as a Formal Parameter
STRUCT s (*); ! Template
BEGIN
INT a;
INT b;
END;
PROC p (i, j);
INT i;
STRUCT .j (s); ! Declare j by referring to template s
BEGIN
...
END;