1
\$\begingroup\$

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?

\$\endgroup\$
1
\$\begingroup\$

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.
  2. Select the "Loading" node under "Conf: [your current configuration]".
  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

enter image description here

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:

enter image description here

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)

\$\endgroup\$
1
\$\begingroup\$

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"

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

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.