pTAL Conversion Guide

Pointers
pTAL Conversion Guide—527302-002
10-41
Alternatives to Using Address Constants in Native
Processes
Alternatives to Using Address Constants in
Native Processes
TAL
Some TAL programs create and access data (for example, buffers or large arrays) in a
process’s user data segment by storing the 16-bit constant addresses of the data in
pointers and using the pointers in statements. TAL programs use this technique
primarily for data items in the upper half (the upper 32K words) of the user data
segment because the TAL compiler does not allocate variables in this area.
You can change the declarations and initializations of such pointers so that your code
will work in native and in TNS processes (see pTAL on page 10-43).
Example 10-18. Nonstructure Pointer With REFALIGNED(8) Clause
?REFALIGNED(2) ! Specify default
...
INT .f REFALIGNED(8); ! Ensure fast access to f
INT .g; ! Use default reference alignment for g
PROC p;
BEGIN
...
DO
IF g THEN ...; ! Compiler emits conservative code for g
IF f THEN ...; ! Compiler emits fast code for f
UNTIL cond;
END;