User`s manual

As already stated, destination will store the correct value only if it can properly
represent the result of the expression (that is, the result fits in destination range).
dim testA as byte
dim testB as byte
dim Cc as word
dim Sa as short
dim Sb as short
dim Sc as short
dim Saa as integer
dim Sbbbb as longint
main:
testA = 250
testB = 10
Cc = testA * testB + testB
' Cc becomes 2510;
Sb = 120
Sc = -100
Sa = Sb + Sc
' Sa becomes 20;
Sa = Sb - Sc
' Sa is short with range -127..128,
' thus, instead of 220,
' Sa becomes -36, because only
' lower 8 bits are registered
Saa = (Sb * Sc) div 13
' Saa becomes -923
Sbbbb = integer(Sb * Sc) * Sc
' Sbbbb becomes 1200000
end.
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
68
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page