User manual
220
mikoBasic PRO for PIC32
MikroElektronika
Boolean Operators
Although mikroBasic PRO for PIC32 does not support boolean type, you have Boolean operators at your disposal for
building complex conditional expressions. These operators conform to standard Boolean logic, and return either TRUE
(all ones) or FALSE (zero):
Operator Operation
and
logical AND
or
logical OR
xor
logical exclusive OR (XOR)
not
logical negation
Unary Operators
Unary operators are operators that take exactly one argument.
Unary Arithmetic Operators
Operator - can be used as a prex unary operator to change sign of a signed value. Unary prex operator + can be
used also, but it doesn’t affect data.
For example:
b = -a
Unary Bitwise Operator
The result of the not (bitwise negation) operator is the bitwise complement of the operand. In the binary representation
of the result, every bit has the opposite value of the same bit in the binary representation of the operand.
Example:
not 0x1234 ‘ equals 0xEDCB
Address and Indirection Operator
In the mikroBasic PRO for PIC32, address of an object in memory can be obtained by means of an unary operator @.
To reach the pointed object, we use an indirection operator ^ on a pointer. See Pointers section for more details.
Operator Operation
not
bitwise complement (unary); inverts each bit
Operator Operation
^
accesses a value indirectly, through a pointer; result is the
value at the address to which operand points
@
constructs a pointer to its operand