TAL Reference Manual

NAMEs and BLOCKs
TAL Reference Manual526371-001
11-5
Coding Data Blocks
Coding Data Blocks
Here are guidelines for coding global data blocks:
Place global declarations, if present, in the following order within a compilation unit:
1. NAME declaration
2. Unblocked global data declarations
3. BLOCK declarations (named or private)
4. PROC declarations
Make sure that the target file contains no more than a total of 256 words of primary
global blocks.
Place variable declarations and any declarations that refer to those variables in the
same block. For example, place the following declarations in the same block:
Make sure the length of any shared data block matches in all compilation units.
Unblocked Declarations
Place all unblocked global declarations (those not contained in BLOCK declarations)
before the first BLOCK declaration.
The compiler creates an implicit data block named #GLOBAL and places all unblocked
declarations (except template structures) in #GLOBAL. A compilation unit can have
only one #GLOBAL block.
The compiler creates an implicit data block for each unblocked template structure
declaration and gives the block the name of the template structure prefixed with an
ampersand (&).
You can bind object files compiled with and without template blocks with no loss of
information. You can use Binder commands to replace the #GLOBAL and template
blocks in the target file.
INT var; !Variable declaration
INT .ptr := @var; !Variable reference