On Monday, May 12th, 2025 at 5:49 AM, Thalia Archibald via TUHS <tuhs(a)tuhs.org>
wrote:
On May 12, 2025, at 04:04, Noel wrote:
That's going to be a real trick;
'as' was written in PDP-11 assembler:
It has, indeed, been quite the challenge to translate. I’ve completed 1114/3531
lines or 7/20 files in my translation of `as` to C. It seems that it was never
ported to C by the original authors, so this is probably the most closely
someone’s looked at many parts of it in a long time.
I’ve very steadily been improving my PDP-11 assembly skills and rather efficient
now. It’s quite tedious tracking all the register effects, though good
signatures annotated with in- and out-registers helps a lot. I feel like a
compiler, manually performing control flow structuring like the Relooper or LLVM
Stackifier algorithms. With this completed, my manual effort will bootstrap
reverse engineering the rest with a proper decompiler.
Thalia
Not sure how helpful it'd be, but pdp11-dec-aout is a valid target for GNU
binutils as of the current version, so objdump may be another
disassembler/analyzer option.
If it helps, here's some stalled-out work on disassembling V2 commands:
https://gitlab.com/segaloco/v2src
Do you have a particular end-goal in mind or is it just an exercise?
- Matt G.