Data Sheet

9. Compiling a program with MPLAB X and MPASM
This section explains how to get started programming the P-Star in assembly using MPLAB X and XC8.
MPLAB X [http://www.microchip.com/mplabx] a free integrated development (IDE) from Microchip for
programming their PIC microcontrollers. MPASM is an assembler that comes with MPLAB X.
For most people, we recommend developing P-Star apps with XC8 [https://www.pololu.com/docs/
0J62/5.3], which allows a mixture of C and assembly code. This section is for advanced users who
only want to use assembly.
MPASM supports two types of code: absolute and relocatable. These instructions will show how to write
absolute code, where the location of every instruction and variable is known ahead of time. The alternative is
relocatable code, which allows multiple assembly files to be combined into one program using a linker.
1. Download and install the latest version of MPLAB X [http://www.microchip.com/mplabx].
2. Find “MPLAB X IDE” in your Start Menu and run it.
3. From the File menu, select “New Project”.
4. On the first screen of the New Project wizard, select the “Microchip Embedded” category and then
select “Standalone Project”. Click “Next”.
5. For the Device, type “PIC18F25K50”. Click “Next”.
Pololu P-Star 25K50 Micro Users Guide © 2001–2017 Pololu Corporation
9. Compiling a program with MPLAB X and MPASM Page 31 of 38