Pages: [1]   Go Down
Author Topic: Atmega disassembler for OS X  (Read 1662 times)
0 Members and 1 Guest are viewing this topic.
Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does anyone have a favorite Atmega disassembler that runs under OS X?. I can boot into Windows if I have to so if there is a particularly good (free) one for Windows, I might be interested. I have the object code out of the AAG weather station that I would like to disassemble, just for grins.
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 178
Posts: 8060
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What format is the object code?  .o?  .hex?

The Arduino distribution includes avr-objdump and avr-readelf which can read and disassemble various object formats.

In a terminal window, try:  /Applications/Arduino22.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-objdump -h (yourfile)
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What format is the object code?  .o?  .hex?

The Arduino distribution includes avr-objdump and avr-readelf which can read and disassemble various object formats.

In a terminal window, try:  /Applications/Arduino22.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-objdump -h (yourfile)

I saved in .hex. I'll give that a try! Thanks!
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What format is the object code?  .o?  .hex?

The Arduino distribution includes avr-objdump and avr-readelf which can read and disassemble various object formats.

In a terminal window, try:  /Applications/Arduino22.app/Contents/Resources/Java/hardware/tools/avr/bin/avr-objdump -h (yourfile)

I saved in .hex. I'll give that a try! Thanks!

That pointed me in the right direction. The right switches are: avr-objdump -j .sec1 -d -m avr flash.hex
Logged

Dallas, Texas
Offline Offline
God Member
*****
Karma: 0
Posts: 861
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I disassembled the factory object code from the weather station. I have no previous experience with looking at disassembled C code for the Atmel processors if this was indeed originally written in C, but it looks pretty straightforward. They used the Y-register as a stack frame pointer for local variable storage and the UART receive routine is interrupt driven. It's an interesting experiment taking apart their code, but I don't think I'm going to spend much more time on it. There aren't any real mysteries about how to use the existing hardware.
Logged

Pages: [1]   Go Up
Jump to: