Pages: [1]   Go Down
Author Topic: Displaying generated code  (Read 707 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there any way of showing the assembler code generated from compiling a sketch. A list of assembler commands against each C++ line would be really nice  smiley. I know some compilers do this but is there any way to make the Arduino compiler do it? I would like to work out where the memory is going and get an idea for what's efficient and what's not.

Thanks,

Julian
Logged

London
Offline Offline
Tesla Member
***
Karma: 10
Posts: 6255
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There is a utility called avr-objdump.exe in  the hardware\tools\avr\bin
directory that will dump a listing of the compiled output (an elf file) showing the C source intermixed with the assembler code. You can also view  a map of the memory allocation.

The following will dump the output of a compiled sketch called mySketch.pde:
avr-objdump –S mySketch.elf

the elf file is in the applet  subdirectory below the location of the sketch source code
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's fantastic. Just what I was looking for.

Thanks,
Julian
Logged

Pages: [1]   Go Up
Jump to: