TAL Reference Manual
Expressions
TAL Reference Manual—526371-001
4-11
Bitwise Logical Operators
Effect on Hardware Indicators
Unsigned add and subtract operators affect the carry and condition code indicators as
described in Testing Hardware Indicators
on page 4-16.
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 4-7
gives information about these operators.
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 of Hardware Indicators
Logical operators set the condition code indicator as described in Testing Hardware
Indicators on page 4-16. Logical operators are always unsigned, however, so condition
codes are not meaningful.
Table 4-7. 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