Validity: Rule, Task
The use of this family of operators is reserved for integer values. If used with real values, the compiler will issue an error. The result is still a value of type integer.
AND binary
Bit-to-bit (binary) AND operation between two integer values.
Syntax |
valueA r_and valueB |
---|---|
valueA |
First value |
valueB |
Second value |
Result |
Binary AND between the two values |
Examples:
; With the data given in the table, value1 will contain the value 0xC0 value1 = inp_w(1) r_and 0c8h
; Binary result of the operation
; value2 will contain the value of the lowest byte of r(1) value2 = r(1) r_and 0xFF |
OR binary
Bit-to-bit (binary) OR operation between two integer values.
Syntax |
valueA r_or valueB |
---|---|
valueA |
First value |
valueB |
Second value |
Result |
Binary OR between the two values |
Examples:
; With the data given in the table, value1 will contain the value 0xF6DC value1 = inp_w(1) r_or 0c8h
; Binary result of the operation
|
NOT binary
NOT bit-to-bit (binary) operation for an integer value.
Syntax |
r_not value |
---|---|
value |
Value |
Result |
Binary NOT of value |
Examples:
; With the data given in the table, value1 will contain the value 0xFFFF092A value1 = r_not inp_w(1)
; Binary result of the operation
|
XOR binary
Bit-to-bit (binary) XOR operation between two integer values.
Syntax |
valueA r_xor valueB |
---|---|
valueA |
First value |
valueB |
Second value |
Result |
Binary XOR between the two values |
Examples:
; With the data given in the table, pippo will contain the value 0xF61C pippo = inp_w(1) r_xor 0C8H
; Binary result of the operation
|