Zophar's Message Domain

Go Back   Zophar's Message Domain > Emulation Talk > Rom Hack

Reply
 
Thread Tools Display Modes
Old 10-13-2004, 08:45 AM   #1
imnonoitall
Junior Member
 
Join Date: May 2004
Posts: 29
Default Just curious about disasseblers

I've downloaded a few disassemblers for the 65c816 but I'm wondering if any of them out there are capable of doing more than just extracting huge blocks of assembly. I'm interested in separating disassembled code into some sort of understandable unit (like functions). From what I've read about 65c816 instructions, it doesn't sound like this would be very easy, but I'm not even all that familiar with x86 assembly yet, so I'm kind of a noobie when it comes to such low level programming. Are there any tools available to split up a 65c816 program into somewhat more structured code? I'm not expecting it to magically produce C code or anything like that, but I just want to separate out areas of code that were meant to do specific things. Probably nothing that can do this yet, is there?

<P ID="signature"></P>
imnonoitall is offline   Reply With Quote
Old 10-13-2004, 03:35 PM   #2
Gil-Galad
Senior Member
 
Gil-Galad's Avatar
 
Join Date: Aug 2000
Posts: 658
Default Re: Just curious about disasseblers

Yes you're probally not going to find a disassembler like what you're looking for. I dabble in 6502 myself and I found this disassembler DCC6502 that has the option for Nintendo register commenting, this option is really usefull and if you could find a 65C816 disassembler with the same option it would help you. This way you would have a idea of what's going on in teh code in some sections.

<P ID="signature"></P>
Gil-Galad is offline   Reply With Quote
Old 10-14-2004, 01:56 AM   #3
king killa
Senior Member
 
Join Date: Jun 2002
Posts: 2,123
Default Re: Just curious about disasseblers

what would be really nice is a disassmbler than could generate code that was ready to re-assemble. This way, you could make dramatic changes to the game and not have to open a hex editor.

<P ID="signature"></P>
king killa is offline   Reply With Quote
Old 10-14-2004, 06:32 AM   #4
Gavin_86
Senior Member
 
Join Date: Aug 2002
Posts: 1,082
Default Re: Just curious about disasseblers

there are actually two of these "smart disassemblers" that i know of for the 6502, or rather the NES specifically. Neither are currently released, however. There is also a third that was made for someones own private use.. i'm not sure if there was ever intention for release. not that it helps, but they're quite handy <img src=smilies/upeyes.gif>

<P ID="signature"><center>I'm just a Paranoid Android watching through my superb crystal viewing glass

.::http://gavin.panicus.orgGavin.Panicus.org</a> ::.
</center></P>
Gavin_86 is offline   Reply With Quote
Old 10-14-2004, 08:24 AM   #5
imnonoitall
Junior Member
 
Join Date: May 2004
Posts: 29
Default Re: Just curious about disasseblers

Thanks for your insights! Now, I have another question that might be a little easier to answer. Does the 65c816 instruction set have any instructions specifically meant for calling procedures, or does it just use long jumps? (I hope that question makes sense - as I mentioned before, I'm not too familiar with assembly.)

<P ID="signature"></P>
imnonoitall is offline   Reply With Quote
Old 10-14-2004, 09:03 AM   #6
Lenophis
Senior Member
 
Lenophis's Avatar
 
Join Date: Apr 2003
Posts: 1,386
Default Re: Just curious about disasseblers

<blockquote><font class="small">In reply to:</font><hr>

I hope that question makes sense - as I mentioned before, I'm not too familiar with assembly.

<hr></blockquote>
I know the feeling, although I don't know if it will help, here's an instrucion set and addressing modes. Hope this helps

<P ID="signature"><img src=http://www.cpinternet.com/~norwin/lenophis/sig.png>
"For lovers of irony; I'll just say one thing...wishes do come true." - Lobster Cowboy. Jade</P>
__________________
Lenophis is offline   Reply With Quote
Old 10-15-2004, 02:04 AM   #7
imnonoitall
Junior Member
 
Join Date: May 2004
Posts: 29
Default Re: Just curious about disasseblers

It does! I think I'm getting a better idea of just how all those numbers work. One final question: How does the processor know what part of the ROM to execute? If I'm right, a 16 bit processor can only use 64 kilobytes in memory at a time, right? So how does it decide where to start and when/where to move on?

<P ID="signature"></P>
imnonoitall is offline   Reply With Quote
Old 10-15-2004, 02:47 AM   #8
Gideon Zhi
Senior Member
 
Join Date: Jul 1999
Posts: 499
Default Re: Just curious about disasseblers

You're wrong.
The 6502 (8-bit) can only address 64 kilobytes of memory at a time, so you have mapper chips built into NES games that can swap out chunks of ROM for other chunks of ROM, thus getting around the limitation.

For 65816 (16-bit), you have 24-bit addressing, so you can address quite a lot more than 64 kilobytes at a time The max on the SNES is 64mbit, but even anything beyond 32 really requires a special non-standard mapping (the standards being LoROM and HiROM.)

As far as where to start is concerned, you need to look at the reset vector, whose address I don't have handy.

<P ID="signature"><hr><center>http://agtp.romhack.net<img src=http://agtp.romhack.net/linkage.gif></a>
Aeon Genesis ~ Aiyah! Thank you for the always and always.</center></P>
Gideon Zhi is offline   Reply With Quote
Old 10-15-2004, 05:07 AM   #9
imnonoitall
Junior Member
 
Join Date: May 2004
Posts: 29
Default Re: Just curious about disasseblers

Wow, confusing! So, how would you specify a 24-bit address for, say, an LDX command? Since the most that LDX accepts is a 16-bit address, how would I specify the most significant byte of the address? (If you're getting tired of my noobish questions and you have a link to a tutorial or something that explains this, that would be great!)

<P ID="signature"></P>
imnonoitall is offline   Reply With Quote
Old 10-15-2004, 03:43 PM   #10
Evil Peer
Senior Member
 
Join Date: Feb 2002
Posts: 205
Default Re: Just curious about disasseblers

Actually, you are correct. It can only address 64k of material at a time. But it is capable of addressing multiple pages of 64k.

As for addressing, the quickest way to find out would be to just look at some ROM traces. Get my Snes9x Tracer and have at it.

And while not quite a discrete function disassembler, Dispel will insert line breaks after every return, which tends to break up the assembly quite well.

---Evil Peer

<P ID="signature"></P>
Evil Peer is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:45 AM.

Contact Us - Zophar's Domain - Archive - Top

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.