Mikroelektronika MIKROE-724 データシート

ページ / 726
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
219
Relational Operators
Use relational operators to test equality or inequality of expressions. All relational operators return TRUE or FALSE.
All relational operators associate from left to right.
Relational Operators Overview
Operator
Operation
=
equal
<>
not equal
>
greater than
<
less than
>=
greater than or equal
<=
less than or equal
Relational Operators in Expressions
The equal sign (
=
) can also be an assignment operator, depending on context.
Precedence of arithmetic and relational operators was designated in such a way to allow complex expressions with-
out parentheses to have expected meaning:
 if aa + 5 >= bb - 1.0 / cc then   ‘ same as: if (aa + 5) >= (bb - (1.0 / cc)) then
   dd = My_Function()
 end if
Bitwise Operators
Use bitwise operators to modify individual bits of numerical operands.
Bitwise operators associate from left to right. The only exception is the bitwise complement operator 
not 
which as-
sociates from right to left.
Bitwise Operators Overview
Operator
Operation
and
bitwise AND; compares pairs of bits and returns 1 if both bits are 1, otherwise it returns 0
or
bitwise (inclusive) OR; compares pairs of bits and generates a 1 result if either or both bits are 1, otherwise it returns 0
xor
bitwise exclusive OR (XOR); compares pairs of bits and generates a 1 result if the bits are complementary, otherwise 
it returns 0
not
bitwise complement (unary); inverts each bit
<<
bitwise shift left; moves the bits to the left, discards the far left bit and assigns 0 to the right most bit.
>>
bitwise shift right; moves the bits to the right, discards the far right bit and if unsigned assigns 0 to the left most bit, 
otherwise sign extends