r/bbcmicro • • 10d ago

VIEW decompilation and C port

Post image

I've just finished (== stopped looking for new bugs) a machine-assisted reverse engineering and decompilation project of the VIEW word processor, producing both an extensively symbolised disassembly but also a portable C version which will run on Unix-ishes (and should be easy to port to other platforms).

The result is about 10kloc, producing a 48kB binary on amd64. It supports most features except for printing (and printer drivers, the hooks are in place internally but there's no way to load drivers. dlopen() would help here if anyone cares enough). The source code quality is... fine; the original was written in hand-tooled machine code with spaghetti code structure, which doesn't map onto C flow control very well, meaning there are still a lot of gotos around but it's mostly comprehensible. The keymap has been reworked to be WordStar-like due to the inexcusable absence of an f0 key on modern computers.

I have no idea if this will be at all useful to anyone, especially given the license situation, but VIEW is a perfectly cromulent word processor which never got the love it deserved at the time, and maybe these would be a good candidate to run on microcontroller writerdecks or similar. Or maybe there are people who just want to use VIEW in the modern world, in which case this is for you, except don't use it for valuable data because I'm sure there are bugs.

See https://github.com/davidgiven/view for the source code.

51 Upvotes

4 comments sorted by

3

u/Blah-Blah-Blah-2023 10d ago

Hmmm very cool stuff! I have been tinkering with View on the Apple //e using Applecorn (which is basically a BBC Micro emulator for the Apple // ProDOS platform.)

1

u/accidentalfish_ 10d ago

Looks great! I love this kind of thing. Will check it out when I get to my laptop.

1

u/Docproc2018 10d ago

This is great, thank you!

1

u/Previous_Kale_4508 10d ago

VIEW was an extremely useful editor that I used as a code editor as well as a word processor for many years. I mimicked the interface in a turbo pascal program when I first switched to working on a PC, but it didn't work as well as I wanted, and it was taking up too many lunch times.. 🤨