[TUHS] Some old DECtapes from Dennis Ritchie

Angelo Papenhoff aap at papnet.eu
Wed Jul 12 03:27:45 AEST 2023


I have attached the extracted e-pi and dmr tapes.

While calculating e and pi is certainly interesting (ken will be able to
say something about that), what I found particularly cool are the unused
block after the e-pi tape!
They contain a bunch of binaries, some of which I was able to identify,
see the e-pi_salvaged directory.

While trying to restore these files I made some observations:
- the programs written in B were compiled with a newer compiler
	than the files from the s2 tape. In particular they have
	the strings at the end of the respective object file and
	not inline where they appear (not in the .data section however)
- the B shell script mentioned in the man page that runs bc and ba is
	in there
- the man shell script is in there
- su has a different password (^S^Y^S)
- mail uses the file 'mbox' not 'mail', consistent with a change in the
	manual from v1 to v2
- some programs appeared to be written in a threaded code similar to B:
	echo, size, fc

The last point was of course most fascinating to me. So I disassembled
the echo binary and found something I would have never expected to
find: a C-like language compiled to threaded code.
My immediate guess was that this must be NB, mentioned in dmr's c
history paper [1], however ken said that NB was always compiled and that
dmr first developed it on the honeywell mainframe.
Now dmr himself in that same paper said one main difference between NB and
early C was the way that vectors/arrays were handled, but this is
clearly not the case because the last1120c compiler treats arrays the
same way as B does. My point is that what exactly NB was seems to be a
bit uncertain.
What we actually have is:
	B implemented in threaded code
	a C-like language with byte types implemented in threaded code
	C implemented in machine code
My personal theory is that this intermediate step is exactly what NB is.
Of course dmr also developed a machine code generator for B on the honeywell
machine, even if it is lost. But how that relates to NB and the PDP-11
exactly I cannot say, so take all that with a grain of salt.
I hope the people who were there and can say more will say something
about this :)

In any case we have this (to me) totally surprising intermediate step
between B and C. I have put some (sloppily commented) disassembled
and/or restored files here [2].
What's very cool is that the dmr tape has a file fc.b, which is clearly
not written in B! My guess is that compiled it will match the fc binary
more or less exactly (I haven't decompiled this one yet).

Also of great interest in this context is the cgd directory on the dmr
tape. I'm not sure how finished this program actually is (I suspect it
is not), but it claims to be a fortran code generator and it has a
structure quite similar to the second pass of the C compiler, with a
difference: The C compiler builds a tree for every expression in the
first pass and dumps that into a file to be picked up by the second
pass. This program builds the tree in the second pass.
Interestingly this is much like I think the B assembler (ba) would have
worked.


Cheers,
Angelo

[1] https://www.bell-labs.com/usr/dmr/www/chist.html
[2] http://squoze.net/NB/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmr_tapes2.tgz
Type: application/x-gtar-compressed
Size: 118220 bytes
Desc: not available
URL: <http://www.tuhs.org/pipermail/tuhs/attachments/20230711/4b257f11/attachment-0001.tgz>


More information about the TUHS mailing list