How can I get an assembly language listing of my Arduino Sketches on Windows?

Matthew Murdoch picture Matthew Murdoch · May 28, 2009 · Viewed 12.4k times · Source

I would like to be able to see an assembly language listing of my Arduino sketches. How can I achieve this?

Update: I am running the Arduino Software on a Windows machine.

Answer

Greg Hewgill picture Greg Hewgill · May 31, 2009

One way to do this is to use avr-objdump on the .elf file created by the build. For example, on OS X I can do this:

$ cd ~/arduino-0015/examples/Digital/Blink/applet
$ avr-objdump -d Blink.elf

(Your path on Windows may be different, obviously.) This produces a disassembly of the code, part of which will look something like this:

0000013a <main>:
 13a:   0e 94 3e 01     call    0x27c <init>
 13e:   0e 94 97 00     call    0x12e <setup>
 142:   0e 94 80 00     call    0x100 <loop>
 146:   fd cf           rjmp    .-6             ; 0x142 <main+0x8>