TAL Programmer's Guide
Simple Variables by Data Type
Using Simple Variables
096254 Tandem Computers Incorporated 6–13
UNSIGNED
Simple Variables
When you declare an UNSIGNED simple variable, you must specify the width, in bits,
of the simple variable. Specify the width as a constant expression in the range 1
through 31, enclosed in parentheses, following the UNSIGNED keyword. The
constant expression can include LITERALs and DEFINEs:
UNSIGNED(5) bit_var; !Width of BIT_VAR is 5 bits
You cannot initialize UNSIGNED variables when you declare them.
Storage Allocation
The compiler packs consecutive UNSIGNED simple variables where possible. That is,
the compiler allocates the first UNSIGNED variable starting on a word boundary, and
then allocates each successive UNSIGNED variable in the remaining bits of the same
word as the preceding variable if:
The variable contains 1 to 16 bits and fits in the same word
The variable contains 17 to 31 bits and fits in the same word plus the next word
If an UNSIGNED variable does not fit in the same word or doubleword, the compiler
starts the variable on a word boundary.
A?
DE
J
STRING a;
UNSIGNED(8) d, e;
UNSIGNED(3) f;
UNSIGNED(5) g;
UNSIGNED(6) h;
UNSIGNED(25) j;
UNSIGNED(2) k;
FG H ?
K
?
360