4.5 Writing a MPLAB program

4.5 Writing a program

Only after all of the preceding operations have been completed we are able to start writing a program. This sample program is fairly simple and serves to illustrate creation of a project.

mplab_11

You should re-write the program to the newly opened window or just copy/paste it from the disk.

mplab_12

Main window with blink.asm program

When the program is copied to "Blink.asm" window, we can use PROJECT -> BUILD ALL command to translate the program to executable HEX form. The last sentence in the window is the most important one, because it shows whether translation was successful or not. "BUILD SUCCEEDED" is a message stating that translation was successful and that there were no errors.
In case that error does show up, you need to double click on error message in 'Output' window. This will automatically take you to the assembler program, to the line where the error was encountered.