TAL Programmer's Guide
Storage Allocation
Introducing the Environment
4–8 096254 Tandem Computers Incorporated
Storage Allocation The compiler generates code during compilation to allocate storage for variables. The
compiler allocates storage as follows:
For global variables—when compilation begins
For local or sublocal variables—when the encompassing procedure or
subprocedure is invoked
The compiler allocates each variable either in the user data segment or in the
automatic extended segment, depending on how you declared the variable.
Allocation in the
User Data Segment
In general, the compiler allocates storage for pointers and other variables in the lower
32K-word area of the user data segment. Figure 4-4 shows the primary and secondary
areas of the lower 32K-word area and the variables each of these areas can contain.
Figure 4-4. Primary and Secondary Storage in the User Data Segment
Global pointers and
direct variables
Data for global indirect
arrays and structures
Local pointers and
direct variables
Bottom of data stack
Data for local indirect
arrays and structures
Dummy stack marker
for main procedure
Sublocal pointers and
direct variables
S[0]
Current top of
data stack
Primary storage areas
Secondary storage areas
Global primary area
(256 words)
Global secondary area
Sublocal primary area
(32 words)
Local primary area
(127 words)
Local secondary area
349
G[0]