pTAL Conversion Guide

Equivalenced Variables
pTAL Conversion Guide527302-002
12-3
Terminology
Figure 12-1. Indirect Arrays in TAL and pTAL
TAL or pTAL Indirect Array
INT .A[0:3] := [10,20,30,40];
! Object date type: INT
! Address type: WADDR
TAL Layout
pTAL Layout
Example 12-1. Valid and Invalid Uses of Equivalenced Pointers
INT .a[0:3];
INT .p = a;
WADDR w;
PROC p1;
BEGIN
a[1] := a[1] + 1; ! Increment the second word of a
p[1] := p[1] + 1; ! Increment the second word of p (= a)
w := @a; ! Assign to w the address of the first
! word of a
w := @p; ! Assign to w the address of the first
! word of p (= a)
@a := w; ! Valid in TAL, error in pTAL
@p := w; ! Valid in TAL, error in pTAL
END;
10
20
30
40
A's data: 1000
1001
1002
1003
VST043.vsd
1000
.A:
10
20
30
40
A: 1000
1001
1002
1003
VST121.vsd