Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view Assembly my C code in MPLAB x

Tags:

c

assembly

mplab

I have code written in C but I need to see the Assembly file so I can optimize the code and figure out how long certain functions will take. Does anyone know of a quick way to pull up the Assembly code?

like image 672
Sid Muthal Avatar asked Jul 23 '14 15:07

Sid Muthal


2 Answers

I also had the same problem as you. Here is what worked for me.

Debug the main program, when finished, choose

" Window >> Debugging >> Disassembly ".

Then you would see the corresponding assembly code.

Hope it could help you out.

like image 157
Rocky Avatar answered Oct 05 '22 11:10

Rocky


For anyone looking for this in the future, I stumbled on the same problem and a better solution.

In MPLAB X, right click the toolbar and select customize (also under View/Toolbars). Now in the menu of things you can drag to the toolbar find the 'Window' tree and under that 'Disassembly Listing File'. Drag that to somewhere on a toolbar (choose one you have set to always be there).

Now when you build something in debug mode you can click the button to open a (nicely formatted) assembly window. If you keep it open it will auto-refresh after each build.

like image 44
SpaceDog Avatar answered Oct 05 '22 11:10

SpaceDog