pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-35
Pointers That Have Different Widths on TNS and
Native Architectures
pTAL
pTAL enforces strong-typing rules for address types. You must explicitly specify all data
type conversions. pTAL does not convert addresses from one type to another
automatically.
Pointers That Have Different Widths on TNS
and Native Architectures
In both TAL and pTAL, a pointer is a variable that holds the address of data instead of
holding the data itself. You must explicitly manage each pointer so that it points to the
correct data when your program uses the pointer in an expression.
TAL
TAL supports two kinds of pointers:
Sixteen-bit standard pointers and sixteen-bit structure pointers that you declare
and manage:
INT .p; ! 16-bit standard pointer
INT .s(t); ! 16-bit structure pointer
Thirty-two bit extended pointers that you declare and manage. Extended pointers
are allocated in the user data segment :
INT .EXT ext_ptr; ! 16-bit pointer to extended memory
On TNS architecture, a standard pointer:
Is 16 bits
Holds either the byte or word address of the data to which it points
Points to data in one of three 64K-word segments:
°
The user data segment
°
The current code segment
°
The system globals segment
Example 10-15. Using Addresses in Expressions (TAL)
INT .EXT p;
INT i;
@p := @p + $UDBL(i) - 2D;