Datasheet
Programming PIC Microcontrollers in BASIC - mikroElektronika
end.
When the program is completed and saved as .pbas file, it can be compiled by clicking on 
Compile Icon (or just hit CTRL+F9) in mikroBasic IDE. The compiling procedure takes 
place in two consecutive steps:
1. Compiler will convert .pbas file to assembly code and save it as blink.asm file. 
2. Then, compiler automatically calls assembly, which converts .asm file into 
executable HEX code ready for feeding to microcontroller. 
You cannot actually make the difference between the two steps, as the process is completely 
automated and indivisible. In case of syntax error in program code, program will not be 
compiled and HEX file will not be generated. Errors need to be corrected in the original .
pbas file and then the source file may be compiled again. The best approach is to write and 
test small, logical parts of the program to make debugging easier.
1.5 Loading program to microcontroller
As a result of successful compiling of our previous code, mikroBasic will generate 
following files:
● blink.asm - assembly file 
● blink.lst - program listing 
● blink.mcl - mikro compile library 
● blink.hex - executable file which is written into the programming memory 
MCL file (mikro compile library) is created for each module you have included in the 
project. In the process of compiling, .mcl files will be linked together to output asm, lst and 
hex files. If you want to distribute your module without disclosing the source code, you can 
send your compiled library (file extension .mcl). User will be able to use your library as if 
he had the source code. Although the compiler is able to determine which routines are 
implemented in the library, it is a common practice to provide routine prototypes in a 
separate text file.
http://www.mikroelektronika.co.yu/english/product/books/picbasicbook/01.htm (6 sur 11)05/11/2004 02:10:07










