pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-44
Alternatives to Using Address Constants in Native
Processes
If the allocated data items contain 32-bit or wider fields, performance for native
processes will be improved by ensuring that each data item begins at a 32-bit memory
boundary. In addition, you must declare the data type of the global array as INT(32),
not as INT, and you must round up the size of each data item you allocate to an even
number of 16-bit words when stepping mem_ptr.
?IFNOT PTAL
?MEM 64
?SOURCE EXTDECS(LASTADDR)
?ENDIF
...
?IF PTAL
mem_ptr := @upper32k;
mem_limit := @upper32k[$OCCURS(upper32k)-1];
?ENDIF
?IFNOT PTAL
mem_ptr := %100000;
mem_limit := LASTADDR;
?ENDIF
@area_1 := mem_ptr;
mem_ptr := mem_ptr '+' 1024;
IF mem_ptr '>' mem_limit THEN CALL error_abort;
@area_2 := mem_ptr;
mem_ptr := mem_ptr '+' 2048;
IF mem_ptr '>' mem_limit THEN CALL error_abort;
@area_3 := mem_ptr;
mem_ptr := mem_ptr '+' 4096;
IF mem_ptr '>' mem_limit THEN CALL error_abort;
Example 10-20. pTAL Space Allocation (page2of2)