02 November 2012, 09:57 | #1 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Disassembler
Using Resource under WinUAE, gets somewhat frustrating. I've been meaning to write my own disassembler for years, and finally got around to it. It's easier than I expected, but like any programming project there's so much that needs to be done.
It currently just loads and does raw disassembly of an Amiga executable. Still need to get "labels" working, follow branches to determine what to actually disassemble and what is data. Etc. |
02 November 2012, 22:38 | #2 |
Global Moderator
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
|
Nice work, copse!
|
03 November 2012, 00:19 | #3 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Hi copse,
why do you want to reinvent the wheel again? Matthew Hey (alias matthey http://eab.abime.net/member.php?u=16145 ) is also already working on an improved version of ADis. Maybe, you could get in contact with him and work together. http://www.heywheel.com/matthey/Amiga/ADis.lha http://www.heywheel.com/matthey/Amiga/programming.html |
03 November 2012, 02:57 | #4 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
My word! Next you will be asking why I would use goto when everyone knows it shouldn't be used |
|
03 November 2012, 03:32 | #5 |
Registered User
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
|
Ok, I can understand your point of view that you prefer to learn writing a disassembler from scratch rather than fighting with other programmers concepts.
But, I guess you won't have to accept all the flaws of the current ADis as far as there are any in Matt's disassembler project. He has excellent knowledge about the 68k instructions and he has always an open mind for discussing things. So, don't hesitate to get in contact with him if he won't reply in this thread anyway sooner or later. I'm sure, he will welcome all your suggestions for improving the ADis disassembler. (Just don't know if he would rename the BRA or JMP instructions into a GOTO cammand ? |
03 November 2012, 04:06 | #6 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,525
|
There's also http://eab.abime.net/showthread.php?t=51527
|
03 November 2012, 07:29 | #7 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
The licensing situation is unclear, as it is inherited code. When I say unclear, I mean it is important to me to be able to look at the license for it, and understand the repercussions. "It should be OK" is not good enough. Also, I find the source code arcane and incomprehensible as to why it does what it does. I understand Matt inherited the code, so I in no way wish to assign the blame for this to him. |
|
03 November 2012, 07:39 | #8 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
Not sure how I missed that in "Today's Posts". |
|
03 November 2012, 15:45 | #9 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
The licensing situation with ADis is very clear. It's open source with no restrictions by the original author and me so use as you wish. I would appreciate that you provide any bug fixes or improvements to possibly be added into a new version. If you release a significantly different version, then choose a different name. Ara's project looks promising also if you would rather go that route. ADis would need some work to make it ready for an editor with GUI like Resource. At that point, it would be kool to make it a debugger also. Last edited by matthey; 03 November 2012 at 17:32. |
|
03 November 2012, 18:17 | #10 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Ah, it was late and I was confused. When looking at existing disassemblers I looked at GNU binutils, AsmPro, WinUAE, IRA and ADis. ADis was probably the best, but to me its licensing situation was unclear. A clear licensing situation to me, is where it has MIT, GPL, BSD or a similar reliable license accompanying source releases. It might be sufficient for you to accept someone saying it is open source, with no restrictions, but unless that's provably in writing in all relevant source releases, I can only take it as hearsay.
But in the end, I think it is best to start from scratch. Having now written a disassembler, I have something I understand 100%. |
03 November 2012, 20:45 | #11 | |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
Quote:
Disassembling instructions is the easy part I think you will find. You will learn plenty programming it yourself. Good luck. |
|
04 November 2012, 08:33 | #12 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Lots more work on this. If anyone has any pointers with regard to the relocation information I want, I'd appreciate it.
I've handled the HUNK_RELOC32, HUNK_DREL32 and HUNK_RELOC32SHORT relocations, but nothing else. I've also looked at a lot of code that parses hunks, and documentation that deals with hunks, and I've been unable to find clear information on hunk types like HUNK_RELOC8. Anyone got any solid leads on these? One piece of code just handled them the same as HUNK_RELOC32, but I believe that is wrong. The UI toolkit I am using is starting to get in the way. On the plus side, the display is virtually generated, so there's no huge buffer that the user scrolls through. But there's no way do Resource-style markup, like inverting symbols that are in other hunks. My symbol/label handling is the only existing code that I am unhappy with. It looks okay, but it is superficially done. Resource does it a lot more intelligently. |
04 November 2012, 09:19 | #13 |
WinUAE developer
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 49
Posts: 26,505
|
RELOC16/8 are linker object only, can't be used in executables.
There is also RELRELOC32 which is supported by AOS (afaik v39+ only) but it has buggy implementation which makes it totally useless. (Relative to relocation address instead of relative to beginning of hunk) Check AROS rom/dos/internalloadseg_aos.c Last edited by Toni Wilen; 04 November 2012 at 09:54. |
05 November 2012, 00:35 | #14 |
Banned
Join Date: Jan 2010
Location: Kansas
Posts: 1,284
|
This is a pretty good hunk reference on Aminet:
http://aminet.net/docs/misc/abfs.lha An online hunk reference with some info not found elsewhere: http://amiga-dev.wikidot.com/file-format:hunk |
05 November 2012, 05:17 | #15 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
I'd be curious to know why anyone would use HUNK_ABSRELOC16. |
|
07 November 2012, 13:01 | #16 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Nobody will ever use it. It makes no sense under AmigaOS, because your sections will rarely be relocated to an address between $ffff8000 and $7fff.
EXT_ABSREF16 references occur often in object files, but they are always refering to absolute external constants and never to an address in a section, so all of them can be resolved by the linker. |
09 November 2012, 23:55 | #17 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
|
|
10 November 2012, 00:06 | #18 |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
To make the frontend code more flexible and less Amiga/68k dependent, I wanted to start by adding support for other platforms that are also m68k-based. The easiest is of course the Atari ST, and the screenshot below is shows disassembly of a random PRG file.
Anyone got any handy links for other 68k executable file formats other than Amiga loadfiles and ST prgs? I've been struggling to find any for the Sharp X68000 platform. |
10 November 2012, 00:33 | #19 | |
Global Moderator
Join Date: Aug 2008
Location: Sidcup, England
Posts: 10,300
|
Quote:
Here is a link to a page with downloads to help you get hold of some X68000 executables: http://gamesx.com/wiki/doku.php?id=x...s_of_mdx_files This is an X68000 hard drive image (129MB): http://nfggames.com/users/eidis/X68000.zip Which can be opened in Windows with DiskExplorer v1.69: http://nfggames.com/users/eidis/editd169.zip to get what you need. |
|
10 November 2012, 02:09 | #20 | |
Registered User
Join Date: Jul 2009
Location: Lala Land
Posts: 520
|
Quote:
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Peasauce disassembler | copse | Coders. General | 1 | 31 January 2021 20:54 |
ReSource disassembler | BlueAchenar | request.Apps | 2 | 04 December 2008 23:18 |
resource disassembler | dalton | request.Apps | 5 | 05 July 2006 21:26 |
ReSource disassembler | gizmomelb | request.Apps | 5 | 21 January 2006 23:50 |
Built in disassembler | XDread | request.UAE Wishlist | 4 | 24 April 2004 02:20 |
|
|