TAL Programmer's Guide
Declaring Substructures
Using Structures
8–12 096254 Tandem Computers Incorporated
Declaring
Substructures
A substructure is a structure embedded within another structure or substructure. In
general, substructures have the following characteristics:
They must be directly addressed.
They have byte addresses, not word addresses.
They can be nested to a maximum of 64 levels.
They can have bounds of [n: n-1]. Such substructures are addressable but use no
memory.
You can declare definition or referral substructures.
Declaring Definition
Substructures
A definition substructure declares a layout and allocates storage for it. To declare a
definition substructure, specify:
The keyword STRUCT
The substructure identifier (with no indirection symbol)
Optional substructure bounds—the default bounds are [0:0] (one occurrence)
A semicolon
The substructure layout (the same BEGIN-END construct as for structures)
The substructure layout can contain declarations for simple variables, arrays,
substructures, filler bits, filler bytes, redefinitions, simple pointers, and structure
pointers. The size of one substructure occurrence is the size of the layout, either in odd
or even bytes. The total layout for one occurrence of the encompassing structure must
not exceed 32,767 bytes.
For example, within definition structure D, you can declare definition substructure
DB. The length of DB is two bytes; the length of D is six bytes:
STRUCT .EXT d; !Declare structure D
BEGIN
STRING da;
STRUCT db; !Declare substructure DB
BEGIN
STRING db1;
STRING db2;
END; !End DB
!Implicit byte filler
INT dc;
END; !End D
388
DA
DC
DB2
DB1
/ / /