MikroElektronika PIC Microcontrollers PIC16 Manuel d'utilisateur Page 90

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 172
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 89
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
If one operand is byte and another is word, byte is converted in word.
If one operand is short and another is integer, short is converted to integer.
If one operand is short and another is longint, short is converted to longint.
If one operand is integer and another is longint, integer is converted to longint.
4. After the first expression is decomposed to simpler ones, each of these is evalu-
ated abiding the rules presented here.
Expression a + b + c is decomposed like this:
First evaluate a + b and get (value of a + b)
This gives us another simple expression
(value of a + b) + c
Let's assume a and b are bytes and c is word,
with values:
a = 23
b = 34
c = 1000
Compiler first calculates value of a + b and assumes
that the result is byte: a + b gives 57.
As c is of word type, result of adding a + b is
casted to word and then added to c: 57 + c is 1057.
Signed and unsigned numbers cannot be combined using arithmetical and logical
operators. Rules presented above are not valid when assigning expression result to
variable.
r = expression
Refer to Assignment and Implicit Conversion for more details.
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
85
page
Illustration
Vue de la page 89
1 2 ... 85 86 87 88 89 90 91 92 93 94 95 ... 171 172

Commentaires sur ces manuels

Pas de commentaire