Author Topic: Momentary diversion - 68HC11 disassembler?  (Read 2243 times)

0 Members and 1 Guest are viewing this topic.

Offline metertech58761Topic starter

  • Frequent Contributor
  • **
  • Posts: 271
  • Country: us
Momentary diversion - 68HC11 disassembler?
« on: April 13, 2025, 07:44:20 am »
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, priced insanely high (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.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8349
  • Country: fi
    • My home page and email address
Re: Momentary diversion - 68HC11 disassembler?
« Reply #1 on: April 13, 2025, 12:12:57 pm »
Because of Fuzix, standard binutils (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 at f4grx.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.
 
The following users thanked this post: DiTBho

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5098
  • Country: gb
Re: Momentary diversion - 68HC11 disassembler?
« Reply #2 on: April 13, 2025, 12:58:16 pm »
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)

The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline PA0PBZ

  • Super Contributor
  • ***
  • Posts: 5495
  • Country: nl
Re: Momentary diversion - 68HC11 disassembler?
« Reply #3 on: April 13, 2025, 01:10:20 pm »
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.
Keyboard error: Press F1 to continue.
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5098
  • Country: gb
Re: Momentary diversion - 68HC11 disassembler?
« Reply #4 on: April 13, 2025, 01:15:01 pm »
6811=68hc11
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: PA0PBZ

Offline metertech58761Topic starter

  • Frequent Contributor
  • **
  • Posts: 271
  • Country: us
Re: Momentary diversion - 68HC11 disassembler?
« Reply #5 on: April 13, 2025, 07:31:23 pm »
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.
 

Offline metertech58761Topic starter

  • Frequent Contributor
  • **
  • Posts: 271
  • Country: us
Re: Momentary diversion - 68HC11 disassembler?
« Reply #6 on: April 14, 2025, 05:15:17 am »
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.
« Last Edit: April 14, 2025, 01:58:59 pm by metertech58761 »
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5098
  • Country: gb
Re: Momentary diversion - 68HC11 disassembler?
« Reply #7 on: April 14, 2025, 06:58:09 pm »
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.
The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 

Offline metertech58761Topic starter

  • Frequent Contributor
  • **
  • Posts: 271
  • Country: us
Re: Momentary diversion - 68HC11 disassembler?
« Reply #8 on: April 14, 2025, 10:45:09 pm »
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 target

Edit: Omit the index to get the direct mode (zero page) instance. One last pass then it's off to explore some code.
« Last Edit: April 15, 2025, 07:20:08 am by metertech58761 »
 
The following users thanked this post: DiTBho

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 8349
  • Country: fi
    • My home page and email address
Re: Momentary diversion - 68HC11 disassembler?
« Reply #9 on: April 16, 2025, 10:35:20 am »
Are there assembly format/directive differences between f9dasm et cetera and binutils for 68hc11?
 

Offline DiTBho

  • Super Contributor
  • ***
  • Posts: 5098
  • Country: gb
Re: Momentary diversion - 68HC11 disassembler?
« Reply #10 on: April 16, 2025, 12:05:54 pm »
ummm, GNU/AS is not Motorola syntax compatible  :-//
That'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 are
  • ImageCract ICC11 v5/v6 (Windows)
  • Avoget HC11 (Dos)


(1) e.g.
Basic interpreter
Forth interpreter/compiler
...

The opposite of courage is not cowardice, it is conformity. Even a dead fish can go with the flow
 
The following users thanked this post: Nominal Animal


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf