pTAL Conversion Guide

Expressions
pTAL Conversion Guide527302-002
13-13
Changing the Location of the Data
Figure 13-1 on page 13-11 and Figure 13-3 on page 13-13 show that changing the
location of a variable from the user data segment to an extended memory segment can
affect whether the address stored in the result pointer, p, is an even-byte or odd-byte
address and, therefore, how such a change could cause your program to generate
different results for TNS and native processes.
Because TNS and native processes treat odd-byte addresses in an extended memory
segment differently, a program might behave differently as a TNS process and a native
process. In an existing program, be careful when you change the data type or location
of a variable that might be referenced in an unrelated portion of your program. By
changing a variable’s declaration, you could cause your program to fail as one kind of
process but not as the other, and the cause of the different behavior could be difficult to
locate.
Figure 13-3. Ending Address After Comparing INT Strings in Extended Memory
and the User Data Segment
PROC p;
BEGIN
INT x[0:1] := ["AB","CD"];
STRING .EXT y[0:1] := ["AX"];
STRING .EXT p;
INT q;
IF x = y FOR 1 WORDS -> @p THEN ... ;
q := p; ! q is assigned "AB" on a TNS processor
! q is assigned "BC" on a TNS/R processor
END;
User Data Segment
AC
Y
B
ABCD
X
P
Extended Memory
Segment
VST013.vsd