I'm using windows XP and I have found the best way for me.
- Bring up command prompt. Mine is
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\carl>
- Copy avr-objdump from \hardware\tools\avr\avr\bin into
C:\Documents and Settings\carl.
It will now be accessable from your command line.
- When you want to disassemble copy the required .elf file into the
same folder as above .
From the command line type:
C:\Documents and Settings\carl>avr-objdump -S BlinkASM.cpp.elf > disasm.txt
- the lising is now in the same folder.
Here is the loop function from blink after disassembly:
00000100 :
// the loop() method runs over and over again,
// as long as the Arduino has power
void loop()
{
digitalWrite(ledPin, HIGH); // set the LED on
100: 80 91 00 01 lds r24, 0x0100
104: 61 e0 ldi r22, 0x01 ; 1
106: 0e 94 70 01 call 0x2e0 ; 0x2e0
delay(1000); // wait for a second
10a: 68 ee ldi r22, 0xE8 ; 232
10c: 73 e0 ldi r23, 0x03 ; 3
10e: 80 e0 ldi r24, 0x00 ; 0
110: 90 e0 ldi r25, 0x00 ; 0
112: 0e 94 ec 00 call 0x1d8 ; 0x1d8
digitalWrite(ledPin, LOW); // set the LED off
116: 80 91 00 01 lds r24, 0x0100
11a: 60 e0 ldi r22, 0x00 ; 0
11c: 0e 94 70 01 call 0x2e0 ; 0x2e0
delay(1000); // wait for a second
120: 68 ee ldi r22, 0xE8 ; 232
122: 73 e0 ldi r23, 0x03 ; 3
124: 80 e0 ldi r24, 0x00 ; 0
126: 90 e0 ldi r25, 0x00 ; 0
128: 0e 94 ec 00 call 0x1d8 ; 0x1d8
}
12c: 08 95 ret
Other options available:
Usage: avr-objdump <option(s)> <file(s)>
Display information from object <file(s)>.
At least one of the following switches must be given:
-a, --archive-headers Display archive header information
-f, --file-headers Display the contents of the overall file header
-p, --private-headers Display object format specific file header contents
-h, --[section-]headers Display the contents of the section headers
-x, --all-headers Display the contents of all headers
-d, --disassemble Display assembler contents of executable sections
-D, --disassemble-all Display assembler contents of all sections
-S, --source Intermix source code with disassembly
-s, --full-contents Display the full contents of all sections requested
-g, --debugging Display debug information in object file
-e, --debugging-tags Display debug information using ctags style
-G, --stabs Display (in raw form) any STABS info in the file
-W, --dwarf Display DWARF info in the file
-t, --syms Display the contents of the symbol table(s)
-T, --dynamic-syms Display the contents of the dynamic symbol table
-r, --reloc Display the relocation entries in the file
-R, --dynamic-reloc Display the dynamic relocation entries in the file
@ Read options from
-v, --version Display this program's version number
-i, --info List object formats and architectures supported
-H, --help Display this information