7

Does anyone have any good recommendations for a Hitachi HD6303 assembler?

I've been working on a project to reverse-engineer an executable made for a Hitachi HD63B03 processor. I've finished the first phase, having successfully disassembled the executable, and annotated the source. However, I'm at a loss for finding an assembler which can successfully build it.

I've tried the Motorola Freeware Assembler, however it needs considerable modifications to support the additional 6303 instructions. I've also tried dasm, however I'll need to make some modifications to make my source code compatible. Dasm also has a few issues relating to the 6303's instructions, with some not being supported.

Preferably the assembler would be freely available. However I'm willing to look into commercial options, provided they're not too expensive. I'd rather be able to instruct the viewers of my project how they could modify, and rebuild the source themselves. Any help would be greatly appreciated.

4
  • 1
    So in which format the disassembled source code is? What program you used to disassemble it?
    – Justme
    Commented Feb 4, 2022 at 6:19
  • I used a "well-known commercial disassembler" to disassemble the binary. Its output format, as specified in the options, is designed to match that of the 'Motorola Freeware Assembler'. For the most part it does, except that the version available doesn't seem to support the HD6303.
    – ajxs
    Commented Feb 4, 2022 at 7:57
  • Depending upon the instruction differences you ay be able to use the 6800 assembler with macros to support the added 6301/3 instructions. This wouldn't require modifying the sources. Commented Feb 4, 2022 at 17:13
  • 1
    CC6303 has a 6303 assembler derived from the Mark Williams codebase. It's open source and fairly hackable if you need to generate anything specific.
    – Alan Cox
    Commented Feb 22, 2022 at 14:55

2 Answers 2

4

DASM appears to be supported and current (recent release Nov '21), if you have specific issues with specific instructions, you could probably raise them with the maintainer and they'll likely fix them.

Lacking that, you can probably fix it yourself and submit a pull request to the maintainer.

You can always fork it, fix it, and supply it yourself.

Finally, it's a macro assembler, so there's a good chance any bad instructions can be replaced with simple macros that assemble them in place (obviously it depends on the the issues you're having). But you can always tweak those instructions to be the macros.

Assembly is pretty simple, so converting to dasm could likely be readily automated, even with something as simple as AWK.

3
  • The Dasm documentation does demonstrate a way to use macros to deal with the missing instructions. To quote their own documentation: "Fixing this will require changes to dasm beyond just fixing the instruction table, and the parser code is not even remotely ready for this". I'd love to help them resolve this, however I've already put so much work into this project. Fundamentally changing dasm is beyond the scope of time I have to give.
    – ajxs
    Commented Feb 4, 2022 at 8:00
  • Regarding automating the translation, this is what I've been doing to get the source code into its current, readable format. It's actually a pretty fun task. However to get the source code into the format dasm expects I need to rename most of the labels, change nearly all of the assembler directives, etc. The changes are extensive.
    – ajxs
    Commented Feb 4, 2022 at 8:02
  • 2
    This was the path I ended up taking in the end. I ended up writing a script to convert the source into a format that dasm understood, and I was able to assemble the source again, identical to the original. All of my work can be seen here: github.com/ajxs/yamaha_dx7_rom_disassembly
    – ajxs
    Commented Feb 5, 2022 at 3:41
4

There's also asl assembler that supports a hell large set of CPUs. The author also supports it (last release dated, at the time of writing this, 2022.02.02), yet without all that fancy github stuff.

2
  • Thank you for the recommendation! I'll take a closer look soon. Hopefully its 6301 support covers the 6303.
    – ajxs
    Commented Feb 4, 2022 at 8:03
  • 1
    @ajxs If I recall correctly, the HD6303 is a specific MCU type with no internal ROM, so the extended bit manipulation instructions are part of the HD6301 instruction set already.
    – Justme
    Commented Feb 4, 2022 at 8:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .