# How to look at the emitted assembly code of MPLAB X IDE

I'm using MPLAB X IDE V5.05 to generate the code to program a PIC32MX470F512L.

It happens that i'm having some problems in the code and i would want to take a look at the assembly code.

To program the pic i'm using an ICD 3.

I'm not finding where the assembly code is.

Can anyone help me find it?

There are two ways that I know of.

The first is viewing the assembly code for your production build within MPLAB X IDE v5.10

1. Open the Project Properties.
3. Check "Load Symbols when Programming or building for production".

Then "Clean and Build" and once finished go to Window -> Debugging -> Output -> Disassembly Listing File

If you are doing this for debugging purposes, clean and build your project for debugging and access the disassembly listing file the same way. No need to change your project settings in this case.

The second way is by examining the .o file with a text editor outside of MPLAB. To do this, add the -S option to xc32-gcc like so:

The build will fail in the IDE but the .o files will be generated and can be found in the "project name".X\build\"configuration name"\production\ _ext folder and you should be able to read them with a text editor (Notepad, Wordpad, Emacs, vim, etc)

You should find a .lst file with your ASM code on folder debug or production within your project folder.

If that's not the case, go to project settings --> XC32 --> Preprocessing & Messages: "Generate ASM listing"

• This is a 32 bit microcontroller thus the compiler is going to be xc32 – bigwillydos Jun 5 at 16:48
• You're right, I have corrected my anawer – Marcos G. Jun 5 at 18:18

In debug mode you can also step through your assembly file:

Just click:

Window/Debugging/Diassembly

Start the debugger/simulator and run until a break-point. Know you can single step in your assembly file.

• That options is disabled, but i could find listing.disasm in Window/Debugging/Output – Nmaster88 Jun 5 at 13:09
• First start the debugger, halt the debugger, then single step in assembly file – Mike Jun 5 at 13:17