Howdy folks, just wanted to share a tool I wrote up today in case it might be useful for
someone else:
https://gitlab.com/segaloco/dis65
This has probably been done before, but this is a bare-bones one-pass MOS 6500
disassembler that does nothing more than convert bytes to mnemonics and parameters, so no
labeling, no origins, etc. My rationale is as I work on my Dragon Quest disassembly,
there are times I have to pop a couple bytes through the disassembler again because
something got misaligned or some other weird issue. My disassembler through the project
has been da65, which does all the labeling and origin stuff but as such, requires a lot of
seeking and isn't really amenable to a pipeline, which has required me to do
something like:
printf "\xAD\xDE\xEF\xBE" > temp.bin && da65 temp.bin && rm
temp.bin
to get the assembly equivalent of 0xDEADBEEF.
Enter my tool, it enables stuff like:
printf "\xAD\xDE\xEF\xBE" | dis65
instead. A longer term plan is to then write a second pass that can then do all the more
sophisticated stuff without having to bury the mnemonic generation down in there
somewhere, plus that second pass could then be architecture-agnostic to a high degree.
Anywho, feel free to do what you want with it, it's BSD licensed. One
"bug" I need to address is that all byte values are presented as unsigned, but
in the case of indirects and a few other circumstances, it would make more sense for them
to be signed. Probably won't jump on that ASAP, but know that's a coming
improvement. While common in disassemblers, I have no intention on adding things like
printing the binary bytes next to the opcodes. Also this doesn't support any of the
undocumented opcodes, although it should be trivial to add them if needed. I went with
lower-case since my assembler supports it, but you should have a fine time piping into
tr(1) if you need all caps for an older assembler.
- Matt G.