65c02 assembly language

Topics pertaining to the emulation or simulation of the 65xx microprocessors and their peripheral chips.
Post Reply
ricard60
Posts: 23
Joined: 28 Dec 2009

65c02 assembly language

Post by ricard60 »

Is there any software on the internet that can convert hexadecimal coded instruccions of the 65c02 to an assembly langauge of this processor?
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Post by GARTHWILSON »

I'm sure there is. That would be a disassembler. The problem is that it won't give meaningful labels (and definitely no comments explaining anything), and it would probably choke where there's data mixed in with instructions. In other words, it is not at all like getting the source code back.
Last edited by GARTHWILSON on Fri Dec 17, 2010 6:10 pm, edited 1 time in total.
User avatar
Ruud
Posts: 259
Joined: 12 Dec 2003
Location: Heerlen, NL
Contact:

Re: 65c02 assembly language

Post by Ruud »

ricard60 wrote:
Is there any software on the internet that can convert hexadecimal coded instruccions of the 65c02 to an assembly langauge of this processor?
I programmed my own one:http://www.baltissen.org/newhtm/auto_dis.htm. I'm happy to give you the latest EXE that still runs under DOS or in a DOS-box.

Garth already mentioned the problem of distinguishing the data and program. I solved it partly by analysing the program instruction by instruction. The problem is that my program isn't an emulator and can't handle indirect jumps and vectorized parts. I solved this by giving it the possebility to disassemble unknown areas.

I don't mind either to do the disassembling for you. You find my email address on my site.

Code: Select all

    ___
   / __|__
  / /  |_/     Groetjes, Ruud 
  \ \__|_\
   \___|       URL: www.baltissen.org

User avatar
dclxvi
Posts: 362
Joined: 11 Mar 2004

Post by dclxvi »

There are two types of disassemblers. There are a symbolic disassemblers that Ruud and Garth mentioned above.

Here are some examples of the output (with some comments added afterwards, and some labels replaced with more meaningful names afterwards):

http://www.brouhaha.com/~eric/retrocomp ... 1basic.dis (Apple 1 BASIC)
http://www.ittybittycomputers.com/IttyB ... sic/TB.asm (Tiny BASIC)
http://retro.hansotten.nl/uploads/6502docs/FOCALV3D.ZIP (Focal)

The other type might be called a numeric disassembler (which does not generate labels). Here is an example of that type of output.

http://home.comcast.net/~mjmahon/AP1BASIC.txt (also Apple 1 BASIC, which also has a few comments added afterwards)

This type of disassembler can be found in the Monitor of Daryl Rictor's (8BIT) SBC-2 (and, I think SBC-3). He has source code you can download on his website.

The first type of disassembler is helpful when you want to generate assembler source from object code. The second type of disassembler is helpful for debugging when you want to see what instructions are actually in memory.

For disassemblers of the first type, I've tended to use disassembly "scripts" for producing source code, rather than trying to figure it out as you go, like Ruud's approach.
blurry
Posts: 3
Joined: 14 Sep 2012

Re: 65c02 assembly language

Post by blurry »

The Apple ][DB and Apple //gs monitors both disassemble 65c02 opcodes as well. You can either download the Apple ][DB (db == debugger) rom and configure various apple emulators to use it. You can select the ][DB rom in JACE from the configuration screen directly (JACE supplies the ][DB rom already). From there you can load the binary into memory and ask the monitor to list it out for you. So for example if you loaded the program at $6000, then from the monitor you would type 6000L
White Flame
Posts: 704
Joined: 24 Jul 2012

Re: 65c02 assembly language

Post by White Flame »

You could also go the whole hog and try out the free version of IDA. It's a professional quality interactive disassembler.

http://www.hex-rays.com/products/ida/su ... ware.shtml

edit: meh, they took out 6502 (and all non-x86) support for the free version, nevermind.
Post Reply