MikroElektronika PIC Microcontrollers PIC16 Manual do Utilizador Página 69

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 172
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 68
Example 2:
Explicit conversion can also be used when you are sure which type you want to
convert expression to. Consider the following lines:
dim tA as byte
dim tB as byte
dim tC as byte
dim A_ as short
dim B_ as short
tA = byte(A_)
B_ = short(tA + tB * tC)
It is important to understand that explicit conversion between signed and unsigned
data does not change binary representation of data; it only allows copying source
to destination. Thus, if A_ was -1, its binary representation would be 11111111,
and A would become 255.
Even if you have ordered the explicit conversion, compiler will perform implicit if
necessary.
Example 3:
You cannot execute explicit conversion on the operand left of the assignment oper-
ator:
word(b) = Bb
' compiler will report an error.
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
64
mikroBASIC
MikroElektronika: Development tools - Books - Compilers
making it simple...
page
Vista de página 68
1 2 ... 64 65 66 67 68 69 70 71 72 73 74 ... 171 172

Comentários a estes Manuais

Sem comentários