User`s manual
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
There are three types of operators in mikroPascal:
Arithmetic Operators
Logical (Bitwise) Operators
Relation Operators (Comparison Operators)
In complex expressions, operators with higher precedence are evaluated before the
operators with lower precedence; operators of equal precedence are evaluated
according to their position in the expression starting from the left.
Example 1:
B and T + A
' (bitwise and) B and T, then add A to the result;
' and is performed first, because it has precedence over +.
Example 2:
A - B + D
' first subtract B from A, then add D to the result;
' - and + have the equal precedence, thus the operation on
' the left is performed first.
Example 3:
' You can use parentheses to override these precedence rules.
' An expression within parentheses is evaluated first, then
' treated as a single operand. For example:
(A + B) * D
' multiply D and the sum of A and B.
A + B * D
' first multiply B and D and then add A to the product.
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
73
page
OPERATORS
Operator Precedence
Operator Priority
not first (highest)
*, div, mod, and, shl, shr second
+, -, or, xor third
=, <>, <, >, <=, >= fourth (lowest)