TAL Programmer's Guide

Declaring Simple Pointers in Structures
Using Structures
096254 Tandem Computers Incorporated 8–17
Declaring Simple
Pointers in Structures
You can declare simple pointers within a structure. A simple pointer is a variable in
which you store the memory address, usually of a simple variable or array, which you
can access with this pointer. The compiler allocates space for the pointer but not for
the data to which the pointer points.
Simple pointers can be standard or extended:
Standard (16-bit) pointers can access addresses in the current user data segment.
Extended (32-bit) pointers can access addresses in any segment, normally the
automatic extended data segment.
To declare a simple pointer inside a structure, specify:
Any data type except UNSIGNED
The simple pointer identifier, preceded by an indirection symbol (. or .EXT)
For example, you can declare STD_POINTER and EXT_POINTER inside
MY_STRUCT:
STRUCT my_struct;
BEGIN
FIXED .std_pointer; !Standard simple pointer
STRING .EXT ext_pointer; !Extended simple pointer
END;
The data type determines how much data a simple pointer can access at a time, as
listed in Table 8-3.
Table 8-3. Data Accessed by Simple Pointers
Data Type Accessed Data
STRING Byte
INT Word
INT(32) Doubleword
REAL Doubleword
REAL(64) Quadrupleword
FIXED Quadrupleword