Bitwise operators (binary)

The binary bitwise operators are &, |, and ^.

Syntax
  Bitwise AND:       
  <operand> & <operand> 
  Bitwise OR:        
  <operand> | <operand>  
  Bitwise XOR:       
  <operand> ^ <operand>  
Description

The & operator performs an AND between the two operands on the bit level.

The | operator performs an OR between the two operands on the bit level.

The ^ operator performs an XOR between the two operands on the bit level.

The operands can be any expression evaluating to an absolute expression.

Example

See the following listing for an example of the binary bitwise operators

Listing: Binary bitwise operators

$E & 3     ; = $2 (%1110 & %0011 = %0010)
$E | 3     ; = $F (%1110 | %0011 = %1111)

$E ^ 3     ; = $D (%1110 ^ %0011 = %1101)