The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Angelo Papenhoff <aap@papnet.eu>
To: Warren Toomey via TUHS <tuhs@tuhs.org>
Subject: [TUHS] Re: Some old DECtapes from Dennis Ritchie
Date: Tue, 11 Jul 2023 19:27:45 +0200	[thread overview]
Message-ID: <ZK2REaTrhAs90l6v@indra.papnet.eu> (raw)
In-Reply-To: <ZKyl8drfW/Bs1LVa@minnie.tuhs.org>

[-- Attachment #1: Type: text/plain, Size: 3188 bytes --]

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/

[-- Attachment #2: dmr_tapes2.tgz --]
[-- Type: application/x-gtar-compressed, Size: 118220 bytes --]

  parent reply	other threads:[~2023-07-11 17:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-11  0:44 [TUHS] " Warren Toomey via TUHS
2023-07-11  6:24 ` [TUHS] " Lars Brinkhoff
2023-07-11  8:39 ` Sebastien F4GRX
2023-07-11  8:57   ` Lars Brinkhoff
2023-07-13  4:42     ` Lars Brinkhoff
2023-07-13 10:00       ` Sebastien F4GRX
2023-07-12  7:01   ` Jonathan Gray
2023-07-11  9:21 ` Henry Bent
2023-07-11 17:27 ` Angelo Papenhoff [this message]
2023-07-11 17:29   ` Angelo Papenhoff
2023-07-11 18:24     ` segaloco via TUHS
2023-07-11 23:54       ` KenUnix
2023-07-13 16:57 ` Jonathan Gray
2023-07-14  5:31   ` Jonathan Gray
2023-07-16  2:35 ` Phil Budne

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZK2REaTrhAs90l6v@indra.papnet.eu \
    --to=aap@papnet.eu \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).