pTAL Conversion Guide

Equivalenced Variables
pTAL Conversion Guide527302-002
12-14
Equivalencing PROCADDRs and PROCPTRs
The pTAL compiler does not verify that the lengths of the objects to which an
equivalenced pointer will refer are equal. The pTAL compiler accepts the declaration in
Example 12-10 on page 12-14 because the address types of both pointers are
WADDR.
Equivalencing PROCADDRs and PROCPTRs
You can equivalence PROCPTRs to PROCADDRs and other PROCPTRs, and you
can equivalence PROCADDRs to PROCPTRs and other PROCADDRs.
Table 12-2. Data Types for Equivalenced Variables
Example Object Data Type Address Type
INT a;
INT .b;
INT .EXT c;
INT
INT
INT
WADDR
WADDR
EXTADDR
BADDR d;
BADDR .e;
BADDR .EXT f;
BADDR
BADDR
BADDR
WADDR
WADDR
EXTADDR
EXTADDR g;
EXTADDR .h;
EXTADDR .EXT i;
EXTADDR
EXTADDR
EXTADDR
WADDR
WADDR
EXTADDR
STRING j;
STRING .k;
STRING .EXT l;
STRING
STRING
STRING
BADDR
BADDR
EXTADDR
Example 12-10. Declaring Pointers in Equivalenced Declarations
INT .a; ! a is a pointer to an INT
FIXED .b = a; ! OK: a and b are pointers; pTAL does not require
! that data referenced by b be contained inside
! data referenced by a
Example 12-11. Equivalencing PROCADDRs and PROCPTRs (page1of2)
PROCPTR a; ! a is a procedure pointer
END PROCPTR;
PROCADDR b; ! b is a procedure address
PROCADDR c = a; ! c is a procedure address equivalenced
! to a procedure pointer
PROCADDR d = b; ! d is a procedure address equivalenced
! to another procedure address
PROCPTR e; ! e is a procedure pointer equivalenced
END PROCPTR = a; ! to another procedure pointer