TAL Reference Manual

Structures
TAL Reference Manual526371-001
8-7
Usage Considerations
occurrence you want to allocate. The default value is 0. For a single-occurrence
structure, omit both bounds or specify the same value for both bounds.
Usage Considerations
The compiler allocates storage for the referral structure based on the following
characteristics:
The addressing mode and number of occurrences specified in the new declaration
The layout of the previous declaration
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.
Example of Referral Structure Declaration
This example declares a template structure and a referral structure that references the
template structure. The referral structure imposes its addressing mode and number of
occurrences on the layout of the template structure:
STRUCT record (*); !Declare template structure
BEGIN
STRING name[0:19];
STRING addr[0:29];
INT acct;
END;
STRUCT .customer(record)[1:50];!Declare referral structure
Simple Variables Declared in Structures
The simple variable declaration associates a name with a single-element data item.
When you declare a simple variable inside a structure, the form is:
VST0804.vsd
type
;
identifier
,