User`s manual

mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
44
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page
Expression is a construction that returns a value. The simplest expressions are
variables and constants, while more complex expressions are constructed from
simpler ones using operators, function calls, indexes, and typecasts.
Rules for creating legal expressions are presented in chapter Implicit Conversion
and Legal Expressions.
These are all expressions:
X
' variable
15
' integer constant
Calc(X, Y)
' function call
X * Y
' product of X and Y
We will present in short notice rules for building expressions here. But, we should
recollect some information beforehand:
Simple data types include: byte, word, short, integer and longint.
Byte and word types hold only positive values so we’ll call them unsigned.
Ranges are:
byte 0 .. 255
word 0 .. 65535
Short, integer, and longint types can hold both positive and negative numbers so
we’ll call them signed. Ranges are:
short -128 .. 127
integer -32768 .. 32767
longint -2147483648 .. 214748364
EXPRESSIONS
Legal
Expressions
MikroElektronika: Development tools - Books - Compilers