TAL Reference Manual

Structures
TAL Reference Manual526371-001
8-4
Usage Considerations
structure-layout
is a BEGIN-END construct that can contain declarations for simple variables,
arrays, substructures, filler bits, filler bytes, redefinitions, simple pointers, and
structure pointers. The size of one occurrence of the structure is the size of the
layout. A single structure occurrence must not exceed 32,767 bytes.
Usage Considerations
Structures declared in subprocedures must be directly addressed. For most other
structures, you should use indirection because storage areas for direct global and local
variables are limited. You access indirect structures by identifier as you do direct
structures.
For very large structures, you should use the .EXT symbol to declare extended indirect
structures. When you declare one or more extended indirect structures (or arrays), the
compiler allocates the automatic extended data segment. If you also must allocate an
extended data segment yourself, follow the instructions given in the
TAL Programmer’s
Guide in Appendix B, “Managing Addressing.”
Structures always start on a word boundary.
Examples of Definition Structure Declarations
This example declares indirect definition structures:
STRUCT .inventory1[0:49]; !Standard indirect structure
BEGIN
INT item;
FIXED(2) price;
INT quantity;
END;
STRUCT .EXT inventory2[0:9999]; !Extended indirect structure
BEGIN
INT item;
FIXED(2) price;
INT quantity;
END;