MikroElektronika PIC Microcontrollers PIC16 Instrukcja Użytkownika Strona 102

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 172
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 171 172

Komentarze do niniejszej Instrukcji

Brak uwag