Please enable JavaScript to view this site.

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

 

B3

B2

B1

B0

inp_w(1)

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

0

1

1

0

1

1

0

1

0

1

0

0

0c8h

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

0

0

1

0

0

0

value1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

0

0

0

0

0

0

 

; 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

 

B3

B2

B1

B0

inp_w(1)

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

0

1

1

0

1

1

0

1

0

1

0

0

0c8h

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

0

0

1

0

0

0

value1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

0

1

1

0

1

1

0

1

1

1

0

0

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

 

B3

B2

B1

B0

inp_w(1)

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

0

1

1

0

1

1

0

1

0

1

0

0

value1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

0

0

0

0

1

0

0

1

0

0

1

0

1

0

1

0

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

 

B3

B2

B1

B0

inp_w(1)

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

0

1

1

0

1

1

0

1

0

1

0

0

0c8h

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

0

0

1

0

0

0

value1

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

1

1

1

0

1

1

0

0

0

0

1

1

1

0

0

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC