EMS Manual
Compiled Filters
EMS Manual—426909-005
5-19
Bit-Extraction Operator
Bit-Extraction Operator
To extract bits from a specified operand creating an unsigned integer value:
operand
is any token value, field, or constant that occupies a byte, word, double word, or
quad word.
bit-1
is an integer in the range 0 through 63 that does not exceed the range implied by
the data type: (0:7) for bytes, (0:15) for words, and so forth.
bit-2
is an integer in the range 0 through 63, inclusive, and must be greater than or
equal to bit-1.
Considerations
The range for the byte data type (0:7) differs from TAL conventions.
Example
This example demonstrates a bit-extraction operator extracting bits from a token value:
IF XYZ^TKN^INTWORD.<12:15> = 15 THEN PASS 1;
This example compares the four low-order bits of the full-word integer value with 15
and checks whether the four bits are all on.
Comparisons
The syntax for comparisons:
operand . < bit-1 : bit-2 >
=
>
>=
operand operand
<>
<
<=