pTAL Conversion Guide

Procedures, Subprocedures, and Procedure
Pointers
pTAL Conversion Guide527302-002
16-21
Passing a .EXT Parameter to a Non-EXT Reference
Parameter
pTAL
In pTAL, you cannot declare a STRING value parameter. The native compiler reports a
syntax error if you declare a STRING value parameter.
Passing a .EXT Parameter to a Non-EXT Reference Parameter
TAL does not support this feature.
In pTAL, you can pass a variable declared as 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 Example 16-18 on page 16-21,
pTAL converts the extended address of i to a WADDR address.
Declaring STRUCTs as Formal Parameters
TAL
In TAL, you can declare a parameter whose data type is a definition STRUCT—that is,
you declare the fields of the STRUCT as part of the formal parameter declaration.
Example 16-17. Formal STRING Value Parameters (TAL)
PROC p (s);
STRING s; ! Value parameter of type STRING
BEGIN
IF s = "A" THEN ... ; ! Fails because "A" is in lower half
... ! of word but s tests upper half
IF s[1] = "A" THEN ... ; ! Succeeds
END;
CALL p("A");
Example 16-18. Passing a .EXT Parameter to a Non-EXT Reference Parameter
(pTAL)
int .EXT i;
PROC p(a);
INT .a;
BEGIN
...
END;