TAL Programmer's Guide

Using Extended Data Segments
Managing Addressing
B–10 096254 Tandem Computers Incorporated
Using Extended Data
Segments
In addition to the user data segment, you can store data in:
The automatic extended data segment
One or more explicit extended data segments
You should use only the automatic extended data segment if possible. You should not
mix the two approaches. If you must use explicit segments and the automatic
segment, however, follow guidelines 4 and 10 in “Using Explicit Extended Segments”
that follows.
Using the Automatic
Extended Segment
When you declare extended indirect arrays or structures, the system automatically
creates and manages an extended data segment for you. You have automatic access,
however, to only one extended data segment.
To declare extended indirect arrays or structures, you specify the .EXT indirection
symbol. To access the array, you use its name in a statement. Declaring and accessing
extended indirect arrays and structures is shown throughout this manual, particularly
in Sections 7 and 8.
Using Explicit
Extended Segments
Your program can allocate and deallocate extended data segments explicitly. Since the
advent of the automatic extended data segment, however, programs usually need not
use explicit extended data segments. The information in this subsection is provided in
support of existing programs.
To create and use an explicit extended segment, you call system procedures. You can
allocate and manage as many extended segments as you need, but you can use only
one extended segment at a time. You can access data in an explicit extended segment
only by using extended pointers. The compiler allocates memory space for the
extended pointers you declare. You must manage allocation of the data yourself.
Here are guidelines for using explicit extended segments:
1. First declare an extended pointer for the base address of the explicit extended
segment.
2. To allocate an explicit extended segment and obtain the segment base address, call
SEGMENT_ALLOCATE_.
3. To make the explicit extended segment the current segment, call
SEGMENT_USE_.
4. If the automatic extended segment is already in place, SEGMENT_USE_ returns
the automatic extended segment’s number. Save this number so you can later
access the automatic segment again.
5. You must keep track of addresses stored in extended pointers. When storing
addresses in subsequent pointers, you must allow space for preceding data items.
6. To refer to data in the current segment, call READX or WRITEX .
7. To move data between extended segments, call MOVEX.