Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Bitwise AND operator performs a bitwise AND of the bits of the first operand with the bits of the second operand. Bitwise AND can be used in both variable and integer constant expressions, but not in floating-point constant expressions. 

Each bit of the two operands is subject to the following logic:

Bitwise AND Truth Table
ABResult
000
010
100
111

Example:

Code Block
X := %00101100 & %00001111

...

Bitwise AND has an assignment form, &=, that uses the variable to its left as both the first operand and the result destination. For example,

Code Block
X &= $F      'Short form of X := X & $F

...