TAL Programmer's Guide
13 Using Special Expressions
096254 Tandem Computers Incorporated 13–1
Special expressions let you perform specialized arithmetic or conditional operations.
This section describes the special expressions listed in Table 13-1.
Table 13-1. Special Expressions
Expression Form Kind of Expression Description
Assignment Arithmetic Assigns the value of an expression to a variable
CASE Arithmetic Selects one of several expressions
IF Arithmetic Conditionally selects one of two expressions
Group comparison Conditional Does unsigned comparison of two sets of data
The result of an expression can be of any data type except STRING or UNSIGNED.
The compiler determines the data type of an expression 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. 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.
An INT(32) expression can include INT(32) and UNSIGNED(17–31) operands.
The system treats UNSIGNED(17–31) operands as if they were 32-bit values. It
places an UNSIGNED(17–31) operand in the right bits of a doubleword and sets
the unused left bits to 0, with no sign extension. For example, for an
UNSIGNED(29) operand, the system fills the three leftmost bits of the doubleword
with zeros.
In all other cases, if the data types do not match, use type transfer functions (described
in the TAL Reference Manual) to make them match.