Command Reference 5-15
BITMASK
Purpose Allows bit logical operations on buffers.
Syntax BITSET
operation
,
buffer-field1
,
buffer-field2
[ , [
invalid label
] [ ,
valid label
] ]
use the above syntax for logical AND/OR or logical exclusive OR.
BITMASK
operation
,
buffer-field1
[ , [
invalid label
] [ ,
valid label
] ]
use the above syntax for Invert.
Process The BITMASK command allows bit logical operations on
buffer-field1
. AND/OR and
exclusive OR take the value in
buffer-field2
and logically combine it with the
contents of
buffer-field1
. The result is stored in
buffer-field1
.
The INVERT operation inverts all bits in
buffer-field1
. If
buffer-field1
or
buffer-
field2
and
invalid label
are defined, control passes to that label. If the operation is
successful and
valid label
is defined, control passes to that label.
RULE: Both
buffer-field1
and
buffer-field2
must be numeric.
Operation
can be one of the following:
Operation
Description
AND Logical And
OR Logical Or
XOR Logical Exclusive Or
INVERT Invert all bits
Buffer-field1
and
buffer-field2
can be one of the following:
Buffer-field1
and
Buffer-
field2
Description
INPUT Input Buffer
Logical Field Name (TEMP1) Temporary Buffer Field
Logical Field Name (LU1) Lookup Buffer Field
Logical Field Name (PR1) Printer Buffer Field
Logical Field Name (Field1)
[Index]
Array Buffer Field
Asc-field only:
Number
String
A number prefixed by the number sign (#)
ASCII string delimited by double quotes
SCRATCH Scratch buffer
Optional Fields
Invalid
and
valid labels
are discussed in “Script Flow" at the beginning this chapter.
Example
This example strips the high 8 bits from TEMP1.
BITMASK AND, TEMP1, #255
See Also BITCLEAR
BITSET
BITSHIFT
BITTEST