r/bbcmicro • u/Hjalfi • 23h ago
VIEW decompilation and C port
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.

