pTAL Conversion Guide

Pointers
pTAL Conversion Guide527302-002
10-6
pTAL
The “Symbol” column notations in Table 10-1 on page 10-5 specify where TAL
allocates your data and specify the object code to generate to access the data on TNS
architecture. Although you can use a 32-bit extended address to access a 64K-word
data segment— for example, the user data segment—your program performs best if
you use direct or indirect addressing to access data in 64K-word segments on TNS
architecture.
pTAL
pTAL defines new data types—called “address types”—that identify the kind
andlocation of data that each of your program’s pointers can reference.
When a native compiler compiles your program to run as a native process, it creates
32-bit byte-address pointers, based on the 16-bit pointers your program declares and
manipulates. On TNS architecture, however, a 16-bit address can be byte-offset or a
word-offset from one of several different base addresses. Address types enable the
native compiler to create 32-bit, byte-address pointers based on your 16-bit pointers,
some of which are word addresses and some of which are byte addresses.
On native architecture, a 32-bit address can reference data anywhere in memory with
optimal performance. Native architecture does not require programs to specify an
addressing type or a memory storage area. To support existing TAL programs,
however, pTAL supports the TAL notation shown in Table 10-1 on page 10-5.
pTAL provides ten address types that control the addresses you store into pointers.
pTAL uses address types to ensure that your program addresses the same relative
data locations on native architecture as it does on TNS architecture. Address types are
like any data types in TAL or pTAL except that:
Address types are used primarily to describe the addresses that you assign to a
pointer, not the data your program is processing.
pTAL determines implicitly the address type of a pointer, based on how you declare
the pointer. You cannot explicitly declare a pointer’s address type.
Only operations that are meaningful for addresses are valid on address types.
An address type identifies, with respect to TNS memory areas:
°
The location of the data to which the pointer points:
°
The 64K-word user data segment
°
A 64K-word user code segment
°
The 64K-word system globals segment
°
An extended-memory segment
°
The PEP table