pTAL Reference Manual (H06.08+)

Equivalenced Variables
HP pTAL Reference Manual523746-006
11-14
Equivalenced Simple Pointers
The code in Figure 11-4 on page 11-14 declares an INT(32) simple pointer equivalent
to an INT simple pointer. Both contain a word address.
pTAL does not verify that the lengths of the objects to which an equivalenced pointer
refers are equal. pTAL accepts the declaration in Example 11-5 on page 11-14
because the address types of both pointers are WADDR.
Figure 11-4. Equivalenced Simple Pointer Declaration
INT .ptr1 := 200;
INT(32) .ptr2 := ptr1;
Example 11-5. Equivalenced Objects of Unequal Length
INT .a; ! a is a pointer to an INT
FIXED .b = a; ! OK: a and b are pointers; pTAL does not require
! that the data referenced by b be contained
! inside the data referenced by a
ptr1 = 200 ptr2 = 200
.
.
.
G[200]
VST307.vsd