23
submitted 2 weeks ago by [email protected] to c/[email protected]

I dumped the ROM out of a piece of retro-tech and have been working through the code in Ghidra. Unfortunately, I can’t exactly decompile it because I don’t think it was originally written in a higher level language.

For example, the stack is rarely used and most functions either deal entirely in global variables, or binary values are passed back using the carry or other low-level bits. Trying to turn it into C would just make spaghetti code with a different sauce.

So my current plan is to just comment every subroutine as best I can, but that still leaves a few massive lookup tables that should be dropped into a spreadsheet of some sort to add context. Not to mention schematics.

My question is what’s the best way to present all of this? I’d like to open-source the result, so a simple PDF is not ideal. I guess I should make a GitHub project? Are there any good examples or templates I can draw on?

you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 9 points 2 weeks ago

Source with lots of comments.

If you do have a C compiler capable of inline ASM for the chip, you could use this to get some structure into the code, and it would allow for Doxygen-Style comments. This will only work with some code that already has a bit of a structure, though.

this post was submitted on 03 Sep 2024
23 points (100.0% liked)

retrocomputing

4026 readers
1 users here now

Discussions on vintage and retrocomputing

founded 1 year ago
MODERATORS