Momentary diversion - 68HC11 disassembler? - Page 1
Forum section: electronics / general

author: metertech58761
author_rank: Frequent Contributor
timestamp: April 13, 2025, 07:44:20 am
content: While the debate rages on over in another thread, I do have a side quest.I've been using f9dasm to reverse engineer some firmware files (and THRSim11 for 'round trip' validation). It was more than capable of handling files I had that were written for the 6809 and a 6801 derivative, and even some earlier HC11 code that barely scratched the surface of the additional features available on that MPU.Now, I've begun looking at some other files I have, but those dip far enough into the HC11's feature set that f9dasm struggles with it.I tried looking around for a HC11 disassembler, but they're either long gone or in one case, pricedinsanelyhigh (even so, that website doesn't even mention support for the HC11).Any suggestions?If Ghidra is my best option, I'll need a Roger Fox-level walkthrough.

author: Nominal Animal
author_rank: Super Contributor
timestamp: April 13, 2025, 12:12:57 pm
content: Because ofFuzix, standardbinutils(including assembler and object tools) supports 68HC11. You can grab the latest binutils, configure it for the 68HC11 target, and compile the tools for yourself; you see this step by step atf4grx.net/toolchain-hc11. It also shows how to use the last GCC version (3.4.6, pretty good for an "old" C compiler) for 68HC11 targets.I'd love to help with that, but note I'm personally Linux-only right now.

author: DiTBho
author_rank: Super Contributor
timestamp: April 13, 2025, 12:58:16 pm
content: never checked myself, but "IDA pro" (usually for Windows 95...Windows XP)?(if you can grab one, from the underground internet, just to see if it works)

author: PA0PBZ
author_rank: Super Contributor
timestamp: April 13, 2025, 01:10:20 pm
content: I checked, Ghidra doesn't know the 6811 but IDA Pro 7.7 does. Not sure if the HC version is the same.No need for old windows versions, it runs fine on W11.

author: DiTBho
author_rank: Super Contributor
timestamp: April 13, 2025, 01:15:01 pm
content: 6811=68hc11

author: metertech58761
author_rank: Frequent Contributor
timestamp: April 13, 2025, 07:31:23 pm
content: IDA Pro popped up in quite a few of the search 'hits'... however, a subscription at $365 / year puts it in the "unjustifiably expensive" category for me, especially since I only need it to disassemble a few ROM images.Just thought I'd check! A few more hours over the course of the day and I'll have a dump ready for a round-trip test anyway.

author: metertech58761
author_rank: Frequent Contributor
timestamp: April 14, 2025, 05:15:17 am
content: Pretty close - it's still a few bytes long, but it compiles and runs. There's always tomorrow.Edit: Aha! I didn't clean up properly after a couple of the f9dasm 'burps'. Code now fits the space allocated to program data. All that remains is the final hex compare.

author: DiTBho
author_rank: Super Contributor
timestamp: April 14, 2025, 06:58:09 pm
content: So, in the end what did you use?P.s.I will do something similar, with the ROM of a typewriter made on 68hc11 + glue logic. I'd like to know how certain things are managed at the low level.

author: metertech58761
author_rank: Frequent Contributor
timestamp: April 14, 2025, 10:45:09 pm
content: I use a text editor called BBEdit and it allows me to have multiple search windows open while going through the dump from f9dasm.That and the HC11 opcode set (I left a copy of the doc I used as a ref in case you don't have it).A couple quick takeaways - $18 is the flag to switch the indexed mode from ,X to ,Y and the BRSET / BRCLR opcodes follow this pattern - opcode operand, index, mask, branch targetEdit: Omit the index to get the direct mode (zero page) instance. One last pass then it's off to explore some code.

author: Nominal Animal
author_rank: Super Contributor
timestamp: April 16, 2025, 10:35:20 am
content: Are there assembly format/directive differences between f9dasm et cetera and binutils for 68hc11?

author: DiTBho
author_rank: Super Contributor
timestamp: April 16, 2025, 12:05:54 pm
content: ummm, GNU/AS is not Motorola syntax compatibleThat's why, for GNU/Linux on HPPA and MIPS I wrote a Motorola/HC11 assembler in C/89.Tired to fight against GNU binutils ... which is good, but ...60% of projects(1) written before the late 90s are written with Motorola syntax.It also works on the rb532a router, which programs an HC11 board at every boot.The HC11 board adds "SPI" and "I2C" functionality to the router.Well, in theory, there are SPI and I2C lines on the rb532a SoC, I can see their registers,but I haven't found out yet if the physical signals are routed on the PCB...Anyway, the best C compilers for HC11 areImageCract ICC11 v5/v6 (Windows)Avoget HC11 (Dos)(1) e.g.Basic interpreterForth interpreter/compiler...