asm Statement
mikroBasic PRO for PIC allows embedding assembly in the source code by means of the asm statement.
You can group assembly instructions with the asm keyword:
asm block of assembly instructions end asm
The only types whose name remains the same in asm as it is in the mikroBasic PRO for PIC are registers, e.g. PORTB, etc.
Basic comments are allowed in embedded assembly code, along with one-line assembly comments starting with semicolon.
Accessing variables
Depending on the place of declaration, accessing a variable can be done in several ways :
- Accessing global variable :
1. If declared under implementation section (visible only in the file where it was declared) :<source_file_name>_<variable_name>.
2. If declared in the interface section (visible throughout the whole project) :_<variable_name>.
3. If accessing registers (declared throughregister,rxorsfrspecifiers, visible throughout the whole project) :<variable_name>. - Accessing local variable :
<routine_name>_<variable_name>. - Accessing routine parameter :
FARG_<routine_name>_<variable_name>.
Note :
Compiler doesn't expect memory banks to be changed inside the assembly code. If the user wants to do this, then he must restore the previous bank selection.
Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!
What do you think about this topic ? Send us feedback!



