TAL Programmer's Guide
Operands
Using Expressions
5–6 096254 Tandem Computers Incorporated
Data Type Aliases The compiler accepts the following aliases for the listed data types:
Data Type Alias
INT INT(16)
REAL REAL(32)
FIXED(0) INT(64)
For consistency, the remainder of this manual avoids using data type aliases. For
example, although the following declarations are equivalent, the manual uses
FIXED(0):
FIXED(0) var;
INT(64) var;
Storage Units Storage units are the containers in which you can access data stored in memory. The
system fetches and stores all data in 16-bit words, but you can access data as any of the
storage units listed in Table 5-4.
Table 5-4. Storage Units
Storage Unit Number of Bits Data Type Description
Byte 8 STRING One of two bytes that make up a word
Word
*
16 INT Two bytes, with byte 0 (most
significant) on the left and byte 1 (least
significant) on the right
Doubleword 32 INT(32), REAL Two contiguous words
Quadrupleword 64 REAL(64), FIXED Four contiguous words
Bit field 1–16 UNSIGNED Contiguous bit fields within a word
Bit field 17–31 UNSIGNED Contiguous bit fields within a
doubleword
*
In TAL a word is always 16 bits regardless of the word size used by the system hardware.
Data Types of Expressions The result of an expression can be of any data type except STRING or UNSIGNED.
The compiler determines the data type of the result from the data type of the operands
in the expression. All operands in an expression must have the same data type, with
the following exceptions:
An INT expression can include STRING, INT, and UNSIGNED(1–16) operands.
The system treats STRING and UNSIGNED(1–16) operands as if they were 16-bit
values. That is, the system:
Puts a STRING operand in the right byte of a word and sets the left byte to 0.
Puts an UNSIGNED(1–16) operand in the right bits of a word and sets the
unused left bits to 0, with no sign extension. For example, for an
UNSIGNED(2) operand, the system fills the 14 leftmost bits of the word with
zeros.