Need to port 89c2051 code to AVR2313....Need a Dis-assembler

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

I have only the *.HEX file to program the 89c2051 and need someone with a good 8051 Dis-assembler to run my file thru it.

I dont have any 8051 experience and these "free" dissers are painfull to say the least.(Not to mention that they are DOS)

Please PM / email me if u can help and I will gladly mail u the file.

Thanks in advance

AVR

Last Edited: Tue. Feb 13, 2018 - 10:10 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe this Disassembler you can use

https://sites.google.com/site/la...

Larry2917

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been using a free 8051 disassembler for about 20 years to convert 8051 code to AVR.   It is called simply dis51.  I think the revision is 05 as the folder is called dis51-05.  It came as C source so I built it for mac command line.  It works as a two pass assembler and allows you to build up the symbol tables by adding them to a file or the command line.   The link in the readme is broken, but archive.org has a cached copy of the page and the download still seems to work http://web.archive.org/web/20130216065102/http://home.earthlink.net:80/~davesullins/software/dis51.html

I have used this as a skeleton to create other dissemblers that I have written.   Namely a custom Motorola 68K disassembler.

 

The best commercial disassembler is IDA-Pro.  this works on windows and will disassemble about anything.  You may have to pay extra for the 8051 plugin.  There is a free limited version that can be used as an evaluation copy.  This is a windows IDE, so I do not use the free version as much.

 

https://onlinedisassembler.com/static/home/index.html is also useful for when you have a few lines of object, or you do not trust the disassembly code.

 

These days I simply use the Postscript language  (yes the printer page description one.)  This is a fully Turing complete stack based programing language (like forth)  It has incredible parsing operators as it is designed to parse any human or machine readable text or binary.   Can handle IBM 360 EBCDIC as well as anything modern.  Postscript also has the ability to create the call graphs so one can see the flowchart of the program.  I recently acquired some 8080 source code which I have matched against an older binary object file.  Interesting enough I can change the mnemonic macros, so it generates AVR opcodes (with expanded macros)  Works surprisingly well.  I did something similar with Motorola 68K code, but hand edited the AVR macros.

 

Any reverse engineering is going to be painful.  Sometimes it is quicker just to rewrite the code from scratch.  You have to solve a many to one problem.   The only way to re create the symbol table is to enter it manually.   This is why I like postscript as it uses key/value dictionary objects to access the internal database.   These I can edit by hand to add useful things  like comment code.    Even With Harvard architecture, one has to separate data from code.   This is why good dissemblers trace through the entry points in the symbol table.  It also gets really tricky when jump tables are used.   Then one sometimes has to deal with intentional code obfuscation.   Or simply code optimization.

 

There is no simple solution.

 

 

 

 

Last Edited: Tue. Feb 13, 2018 - 08:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Note that this is a 14-year dead thread.

 

It was only woken by spam, now deleted.

 

EDIT

 

See: https://www.avrfreaks.net/comment...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Feb 13, 2018 - 09:55 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

And to make sure this does not wake up again.....

 

JIm

If you want a career with a known path - become an undertaker. Dead people don't sue! - Kartman

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB user

Topic locked