pTAL Conversion Guide

Pointers
pTAL Conversion Guideā€”527302-002
10-38
Pointers That Have Different Widths on TNS and
Native Architectures
Figure 10-6 on page 10-38 shows how TAL allocates memory for a pointer on TNS
architecture and how pTAL allocates memory for the same pointer on native
architecture.
INT .p;
INT .p = ā€˜Pā€™ := "AB";
INT .SG p;
INT .SGX p;
INT .EXT p;
WADDR
CWADDR
SGWADDR
SGXWADDR
EXTADDR
16
16
16
16
32
word
word
word
word
byte
32
32
16
32
32
byte
byte
word
byte
byte
PROCPTR p; END PROCPTR; PROCADDR 16 N. A. 32 N. A.
Note. pTAL treats all P-relative arrays as if you declared them without indirection.
Figure 10-6. Example of Pointer Widths
INT(32) .p;
@p := 41;
p := 1234;
Table 10-9. Pointer Widths (page2of2)
Pointer
Address
Type
TNS Architecture
Native
Architecture
Pointer
Width
Address
Unit
Pointer
Width
Address
Unit
0 2 4 6 8 80828486889092
123441
Allocation of the pointer p on a TNS processor.
The address, 41, is a word offset.
0 2 4 6 8 80828486889092
123482
Allocation of the pointer p on a TNS/R processor.
The address, 41, is a byte offset.
VST034.vsd