TAL Programmer's Guide

Compiling With Relocatable Data Blocks
Compiling Programs
14–18 096254 Tandem Computers Incorporated
Example of Data Blocks Created by the Compiler
Table 14-2 shows the primary, secondary, and extended data blocks the compiler
creates from the example global data declarations, including the names (shown in
boldface) that the compiler gives them.
Table 14-2. Data Blocks Created by the Compiler
Data Blocks Created by the TAL Compiler
Example Declaration Primary Data Block Secondary Data Block Extended Data Block
Implicit
block INT a;
INT .b[0:9];
INT .EXT c[0:14];
INT(32) .d;
LITERAL lmt = 32;
#GLOBAL contains:
Variable A (1 word)
Pointer for B (1 word)
Pointer for C (2 words)
Simple pointer D (1 word)
LITERAL (0 words)
.#GLOBAL contains:
Data for B (10 words)
$#GLOBAL contains:
Data for C (15 words)
Named
block
BLOCK myglobals;
INT g;
INT .h[0:9];
INT .EXT k[0:14];
LITERAL one = 1;
END BLOCK;
MYGLOBALS contains:
Variable I (1 word)
Pointer for J (1 word)
Pointer for K (2 words)
LITERAL (0 words)
.MYGLOBALS
contains:
Data for J (10 words)
$MYGLOBALS contains:
Data for K (15 words)
Private
block
NAME mysource;
BLOCK PRIVATE;
INT x;
INT .y[0:9];
INT .EXT z[0:14];
DEFINE xaddr =
INT(32)#;
INT ro_array = 'P'
:= [0,1];
END BLOCK;
MYSOURCE contains:
Variable X (1 word)
Pointer for Y (1 word)
Pointer for Z (2 words)
DEFINE (0 words)
Read-only array (0 words)
.MYSOURCE contains:
Data for Y (10 words)
$MYSOURCE contains:
Data for Z (15 words)
Address Assignments
The compiler assigns each direct variable and each pointer an offset from the
beginning of the encompassing global data block. Within the data block, it allocates
storage for each data declaration according to its data type and size.
Binder uses the address of the data block and the offset within the block to construct
addresses for indirect data in the secondary and extended storage areas.