TAL Programmer's Guide
Arithmetic Expressions
Using Expressions
5–20 096254 Tandem Computers Incorporated
Bitwise Logical Operators You use logical operators—LOR, LAND, and XOR—to perform bit-by-bit operations
on STRING, INT, and UNSIGNED(1–16) operands only. Logical operators always
return 16-bit results. Table 5-14 gives information about these operators.
Table 5-14. Logical Operators and Result Yielded
Operator Operation Operand Type Bit Operations Example
LOR Bitwise
logical OR
STRING, INT, or
UNSIGNED(1–16)
1 LOR 1 = 1
1 LOR 0 = 1
0 LOR 0 = 0
10 LOR 12 = 14
10 1 0 1 0
12 1 1 0 0
—— — — — —
14 1 1 1 0
LAND Bitwise
logical ADD
STRING, INT, or
UNSIGNED(1–16)
1 LAND 1 = 1
1 LAND 0 = 0
0 LAND 0 = 0
10 LAND 12 = 8
10 1 0 1 0
12 1 1 0 0
—— — — — —
8 1 0 0 0
XOR Bitwise
exclusive
OR
STRING, INT, or
UNSIGNED(1–16)
1 XOR 1 = 0
1 XOR 0 = 1
0 XOR 0 = 0
10 XOR 12 = 6
10 1 0 1 0
12 1 1 0 0
—— — — — —
6 0 1 1 0
The Bit Operations column in the table shows the bit-by-bit operations that occur on
16-bit values. Each 1-bit operand pair results in a 1-bit result. The bit operands are
commutative.
Effect on Hardware Indicators
Logical operators set the condition code indicator, as described in “Testing Hardware
Indicators” later in this section. Logical operators are always unsigned, however, so
condition codes are not meaningful.