Computer Old Farts Forum
 help / color / mirror / Atom feed
* [COFF] Pipeable MCS6500 Family Disassembler
@ 2023-08-28 21:29 segaloco via COFF
  0 siblings, 0 replies; only message in thread
From: segaloco via COFF @ 2023-08-28 21:29 UTC (permalink / raw)
  To: COFF

Howdy folks, just wanted to share a tool I wrote up today in case it might be useful for someone else:

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-08-28 21:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-28 21:29 [COFF] Pipeable MCS6500 Family Disassembler segaloco via COFF

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).