A 6502 disassembler that runs on the NES.

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
A 6502 disassembler that runs on the NES.
by on (#208747)
This might be the most useless piece of software I've ever written. Haha.

In case you ever wanted a 6502 disassembler to run on the NES that can only disassemble it's own source code:
Image

Donload source/.nes: http://files.slembcke.net/temp/Disassembler.tgz

edit: added a download link
Re: A 6502 disassembler that runs on the NES.
by on (#208748)
That's actually really cool. Is the code small enough to fit in WRAM? Because it might be cool to hack into other games.
Re: A 6502 disassembler that runs on the NES.
by on (#208751)
That could be fun to play with, even if not particularly useful.

Totally unrelated, but I couldn't help noticing that the animated GIF was made from lossily compressed images, resulting in a huge file due to the numerous color artifacts around the text. If you used clean images instead, that GIF could easily be 10 times smaller, and it'd look better too. When possible, avoid JPEG/MPEG when capturing screenshots/video from old consoles.
Re: A 6502 disassembler that runs on the NES.
by on (#208811)
Although it does not seem very useful, it is curious.
Re: A 6502 disassembler that runs on the NES.
by on (#208815)
There's no link?

How does it determine the alignment of the code?
Re: A 6502 disassembler that runs on the NES.
by on (#208857)
I'm kind of surprised that people want to see the code for this. :p I added a download link to the first post.

This is my first cc65 program in 10+ years (I think I last used it in like 2003), and first NES project so I wouldn't expect to learn much from it. Compared to the 2 kb Apple II monitor program, this 4+ kb disassembler is a monstrosity. :p It was easy to make though.

@puby It doesn't. It's starts at $c000, and there is only one code segment.
Re: A 6502 disassembler that runs on the NES.
by on (#208958)
I let it go all the way around just to see.

Didn't quite manage to wrap perfectly. ;)
Attachment:
disassembler_wrap.png
disassembler_wrap.png [ 3.26 KiB | Viewed 3364 times ]
Re: A 6502 disassembler that runs on the NES.
by on (#209062)
Image
Re: A 6502 disassembler that runs on the NES.
by on (#209120)
Is that a "quine"?
Re: A 6502 disassembler that runs on the NES.
by on (#210141)
Now with split scrolling!
Image

Fixed the jerky scrolling by switching to NMIs as well. I had forgotten how much fun 6502 assembly was even if it's not very practical in 2018. :p