pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-37
Pointers That Have Different Widths on TNS and
Native Architectures
@sp := @sp '+' 2; ! @sp := %H202;
Adding 2 to a byte address on native architecture is the same as on TNS
architecture.
@p := @p[3]; ! @p := %H208;
Indexing the word address in p by 3 on TNS architecture requires indexing that
word address by 6 on native architecture.
@sp := @sp[3]; ! @sp := %H205;
Indexing the address in sp by 3 on native architecture is the same as on TNS
architecture. The address in sp is incremented by 3.
@e := $UDBL(@p) '<<' 1; ! @e := %H208;
Converting a 16-bit word address to a 32-bit extended address does not require a
change to the internal representation of the address. The address in p is moved
to e.
pTAL converts these address types to 32 bits if you compile your program to run as a
native process:
BADDR
WADDR
SGXBADDR
SGXWADDR
CBADDR
CWADDR
PROCADDR
Table 10-9 on page 10-37 gives an example of each type of pointer and shows how
many bits TAL allocates to the pointer on TNS architecture and how many bits pTAL
allocates to the pointer on native architecture.
Table 10-9. Pointer Widths (page1of2)
Pointer
Address
Type
TNS Architecture
Native
Architecture
Pointer
Width
Address
Unit
Pointer
Width
Address
Unit
STRING .p;
STRING .p = ‘P’ := "AB";
STRING .SG p;
STRING .SGX p;
STRING .EXT p;
BADDR
CBADDR
SGBADDR
SGXBADDR
EXTADDR
16
16
16
16
32
byte
byte
byte
byte
byte
32
32
16
32
32
byte
byte
byte
byte
byte