Are there any disassemblers for weird 6502 variants?

Discussion of development of software for any "obsolete" computer or video game system. See the WSdev wiki and ObscureDev wiki for more information on certain platforms.
Post Reply
Joe
Posts: 650
Joined: Mon Apr 01, 2013 11:17 pm

Are there any disassemblers for weird 6502 variants?

Post by Joe »

I have a device containing a modified 6502. I would like to disassemble its firmware ROM. Are there any disassemblers out there that can handle a modified instruction set?

If I really have to, I can make my own disassembler, but surely there's an easier way.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: Are there any disassemblers for weird 6502 variants?

Post by Oziphantom »

I doubt anything handles those, they are somewhat rare. Modifying https://github.com/fadden/6502bench/ is probably your best bet.
lidnariq
Posts: 11432
Joined: Sun Apr 13, 2008 11:12 am

Re: Are there any disassemblers for weird 6502 variants?

Post by lidnariq »

For whatever other flaws may exist in bisqwit's clever-disasm, I found it pretty easy to extend to support for the Mitsubishi 740 65C02-based microcontrollers.
Drag
Posts: 1615
Joined: Mon Sep 27, 2004 2:57 pm
Contact:

Re: Are there any disassemblers for weird 6502 variants?

Post by Drag »

If all you need is a quick and dirty disassembly, it might be simplest to just write a disassembler yourself. That way, you'll have a "baseline" tool which gives you the basic stuff you need, and you'd have it pretty quickly.

Taking a fancier disassembler and extending it would be ideal in the long-run, but might also require additional work which goes beyond simply "read bytes get text". For example, the disassembler you're extending might also want an emulator for the modified instruction set so it can perform static analysis (and give a better disassembly). If you're OK with that, then try that out instead.

Either of these things might be the "easier" thing depending on who you ask (including yourself), so it comes down to what your particular needs are, and what you're willing to put your effort towards (e.g., figuring out how to extend an existing codebase vs. writing it from scratch yourself), and how often you're going to need what the tool does.

I think I would write my own disassembler first, just to have something at all, and would move onto extending an existing 6502 disassembler later, if it turns out I need something more robust. That's just my personal take though, and might not be what others would do. :P
Joe
Posts: 650
Joined: Mon Apr 01, 2013 11:17 pm

Re: Are there any disassemblers for weird 6502 variants?

Post by Joe »

Hmm. I doubt there will be anything interesting in this firmware ROM, and a couple of this CPU's addressing modes are different from a typical 6502, so it sounds like the best option is writing my own disassembler.

Oh well.
Revenant
Posts: 462
Joined: Sat Apr 25, 2015 1:47 pm
Location: FL

Re: Are there any disassemblers for weird 6502 variants?

Post by Revenant »

MAME's 'unidasm' tool with the "-arch r65c19" option should do what you want (at least at a glance, the instructions it supports seem to match the table in the documentation you posted).
Joe
Posts: 650
Joined: Mon Apr 01, 2013 11:17 pm

Re: Are there any disassemblers for weird 6502 variants?

Post by Joe »

You're right, that's the same CPU core. It looks like the CPU core was used in a few MCUs, so if I come across any others in my collection I'll give that a shot.
Post Reply