Specifications

mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix C: Development Systems
goto Loop
Increment incf cnt,f
movf cnt,w
movwf PORTB
goto Loop
Decrement decf cnt,f
movf cnt,w
movwf PORTB
To enable the compiler to perform its task successfully, it is necessary that a document
containing this program has the extension, .asm in its name, for example: Program.asm
When a specialized program (MPLAB) is used, this extension will be automatically added. If any
other program for text processing (Notepad) is used then the document should be saved and
renamed. For example: Program.txt -> Program.asm.
Note for lazy ones: skip this procedure, open a new .asm document in MPLAB and simply copy/
paste the text of the program written in assembly language.
COMPILING PROGRAM
The microcontroller does not understand assembly language as such. This is why it is necessary to
compile the program into machine language. It is more than simple when using a specialized
program (MPLAB) because a compiler is part of the software! Just one click on the appropriate
icon solves the problem and a new document with .hex extension pops out. It is actually the same
program, but compiled into computer language which the microcontroller perfectly understands.
Such documentation is commonly named "hex code" and seemingly represents a meaningless
sequence of numbers in hexadecimal numerical system.
:03000000020100FA1001000075813F
7590FFB29012010D80F97A1479D40
90110003278589EAF3698E8EB25B
A585FEA2569AD96E6D8FED9FAD
AF6DD00000001FF255AFED589EA
F3698E8EB25BA585FEA2569AD96
DAC59700D00000278E6D8FED9FA
DAF6DD00000001FF255AFED8FED
9FADAF6DD000F7590FFB29013278
E6D8FED9FADAF6DD00000001FF2
55AFED589EAF3698E8EB25BA585
FEA2569AD96DAC59D9FADAF6D
D00000001FF255AFED8FED9FADA
F6DD000F7590FFB29013278E6D82
78E6D8FED9FA589EAF3698E8EB2
5BA585FEA2569AD96DAF6DD000
00001FF2DAF6DD00000001FF255A
ADAF6DD00000001FF255AFED8FE
D9FA
http://www.mikroe.com/en/books/picmcubook/appc/ (2 of 7)5/3/2009 11:36:25 AM