TAL Programmer's Guide

Using Simple Pointers
Using Pointers
9–2 096254 Tandem Computers Incorporated
Using Simple Pointers A simple pointer is a variable into which you must store a memory address, usually of
a simple variable or an array element. When you refer to a simple pointer identifier in
expressions, you access the item whose address is stored in the simple pointer.
Before accessing data through a simple pointer, you must declare the pointer and store
a memory address in it. You can store an address by initializing the pointer when you
declare it or by assigning an address to it later in an assignment statement.
Declaring Simple Pointers To declare a simple pointer, specify:
Any data type except UNSIGNED
An identifier, preceded by an indirection symbol (. or .EXT)
To declare a standard simple pointer, use the standard indirection symbol (.):
INT .my_ptr;
To declare an extended simple pointer, use the extended indirection symbol (.EXT):
INT .EXT my_xptr;
Extended pointer declarations should precede other global or local declarations. The
compiler emits more efficient machine code if it can allocate extended pointers
between G[0] and G[63] or between L[0] and L[63].
Specifying a Data Type When you declare a simple pointer, you can specify any of the following data types.
The data type determines how much data a simple pointer can access at a time, as
listed in Table 9-1.
Table 9-1. Data Accessed by Simple Pointers
Data Type Accessed Data
STRING Byte
INT Word
INT(32) Doubleword
REAL Doubleword
REAL(64) Quadrupleword
FIXED Quadrupleword