MPLAB IDE Projects

MPASM Assembler

MPLAB IDE Projects

A project in MPLAB IDE is a group of files needed to build an application, along with their associations to various build tools. Below a generic MPLAB IDE Project using the MPASM assembler tool is shown.

Figure: Project Relationships

In this MPLAB IDE Project, an assembly source file (prog.asm) is shown with its associated assembler (MPASM assembler). MPLAB IDE will use this information to generate the object file prog.o for input into MPLINK linker.

The C source file main.c is also shown with its associated MPLAB C1X compiler. MPLAB IDE will use this information to generate an object file (main.o) for input into the linker (MPLINK linker). See either the MPLAB C17 Compiler User's Guide (DS51290) for PIC17CXXX devices or the MPLAB C18 Compiler User's Guide (DS51288) for PIC18XXXXX devices for more information on using these compilers.

In addition, precompiled object files (precomp.o) may be included in a project, with no associated tool required. Types of precompiled object files that are generally required in a project are:

  • Start up code
  • Initialization code
  • Interrupt service routines
  • Register definitions
  • Precompiled object files are often device and/or memory model dependent. For more information on available Microchip precompiled object files, see either the MPLAB C17 Compiler Libraries (DS51296) for PIC17CXXX devices or the MPLAB C18 Compiler Libraries (DS51297) for PIC18XXXXX devices.

    Some library files (math.lib) are available with the compiler. Others may be built outside the project using the librarian tool (MPLIB librarian). See the MPLIB Object Librarian section later in this manual for more information on using the librarian. For more information on available Microchip libraries, see the MPLAB C1X library documents previously mentioned.

    The object files, along with library files and a linker script file (device.lkr) are used to generate the project output files via the linker (MPLINK linker). See the MPLINK Object Linker section later in this manual for more information on linker script files and using the linker.

    The main output file generated by MPLINK linker is the Hex file (prog.hex), used by simulators (MPLAB SIM), emulators (MPLAB ICE 2000) and programmers (PRO MATE II and PICSTART Plus). The other output files are:

    • COFF file (.out). Intermediate file used by MPLINK linker to generate Code file, Hex file, and Listing file.
  • Code file (.cod). Debug file used by MPLAB IDE.
  • Listing file (.lst). Original source code, side-by-side with final binary code.
  • Map file (.map). Shows the memory layout after linking. Indicates used and unused memory regions.

  • Microchip Technology Inc.
    Microchip's Web Site
    Voice: (480) 792-7200
    Fax: (480) 899-9210
    Microchip's E-mail Address
    PreviousNext