pTAL Guidelines for TAL Programmers

Coding Guidelines
pTAL Guidelines for TAL Programmers527256-002
2-11
Pointers and Addresses
The granularity of the data address, which is one of:
°
A byte address
°
A word address
The width of the address, which is one of:
°
16 bits
°
32 bits
Table 2-1 on page 2-11 lists the 10 address types in pTAL. For each data type, the
table shows the attributes of the address in terms of TNS processor organization, as
follows:
An example that uses the data type
The object data type
The address type
The location where the data for the variable is stored
The granularity of the address; that is, whether it contains the byte or word address
of the data
The width of the address (16 or 32 bits)
In each of the examples, the address type is determined implicitly by the type of the
object to which the pointer points.
Table 2-1. pTAL Address Types (page1of2)
Example Pointer or
Declaration
Object
Data Type
Data
Location
Address
Type Granularity Width
1
INT .i; INT User Data
Segment
WADDR 16-bit word 16/32
bits
STRING .s; STRING User Data
Segment
BADDR byte 16/32
bits
INT .EXT i; INT Extended
Data
Segment
2
EXTADDR byte
3
32 bits
INT .SG sgw; INT System
Global
Segment
SGWADDR 16-bit word 16 bits
1. The notation “16/32 bits” means 16 bits on TNS architecture, 32 bits on native architecture.
2. On TNS architecture, extended pointers (pointers declared using .EXT notation) contain 32 bits and can
reference data in any segment including code segments and the user data segment. On native architecture,
extended pointers also contain 32 bits but using them to reference segments other than extended data segments
is more restricted.
3. Extended addresses must reference data on even-byte boundaries, except STRING data, which can be
referenced on either an even-byte or an odd-byte boundary.