MikroElektronika PIC Microcontrollers PIC16 Manuel d'utilisateur Page 102

  • 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 101
mikroBASIC
- Basic Compiler for Microchip PIC microcontrollers
MikroElektronika:
Development
tools
-
Books
-
Compilers
mikroBASIC
making it simple...
97
page
Sometimes it can be useful to write part of the program in assembly. ASM state-
ment allows you to embed PIC assembly instructions into Basic code.
Note that you cannot use numerals as absolute addresses for SFR or GPR vari-
ables in assembly instructions. You may use symbolic names instead (listing will
display these names as well as addresses). Also, you cannot use Labels in assem-
bly; instead, you can use relative jumps such as goto $-1.
Declaration of asm statement is:
asm
statementList
end asm
where statementList is a sequence of assembly instructions.
Be careful when embedding assembly code - mikroBasic will not check if assem-
bly instruction changed memory locations already used by Basic variables.
Also, you cannot write comments in assembly.
asm
movlw 67
movwf TMR0
end asm
asm
' second instruction is incorrect, see above
MOVLW 0
MOVWF $5
MOVWF PORTA
end asm
' note that you cannot write comments in assembly
ASM Statement
Example
Vue de la page 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 171 172

Commentaires sur ces manuels

Pas de commentaire