From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10144 invoked from network); 16 Jul 2021 00:03:36 -0000 Received: from minnie.tuhs.org (45.79.103.53) by inbox.vuxu.org with ESMTPUTF8; 16 Jul 2021 00:03:36 -0000 Received: by minnie.tuhs.org (Postfix, from userid 112) id E5EEA9C7F9; Fri, 16 Jul 2021 10:03:34 +1000 (AEST) Received: from minnie.tuhs.org (localhost [127.0.0.1]) by minnie.tuhs.org (Postfix) with ESMTP id F10A89C7F1; Fri, 16 Jul 2021 10:02:58 +1000 (AEST) Authentication-Results: minnie.tuhs.org; dkim=pass (1024-bit key; unprotected) header.d=ccc.com header.i=@ccc.com header.b="RNFC3Wj5"; dkim-atps=neutral Received: by minnie.tuhs.org (Postfix, from userid 112) id 9E9ED9C7F1; Fri, 16 Jul 2021 10:02:55 +1000 (AEST) Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) by minnie.tuhs.org (Postfix) with ESMTPS id 91BC19C7F0 for ; Fri, 16 Jul 2021 10:02:53 +1000 (AEST) Received: by mail-qt1-f173.google.com with SMTP id d1so5874592qto.4 for ; Thu, 15 Jul 2021 17:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccc.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B5/c+fQi34KPsAMPhaiCowFFofm6eCzVaUXJz3o9Vw0=; b=RNFC3Wj55AEU45+zDWlxGz2aCWx7C0Ka72WklKwXfb3oW4WFLxxmPThcz9CvL8CcOB cDJhVJCvCr3JqktRNbfP7pFBnihK1QE/3sPQGSG3SpZN/AvlsztobZ2rkh4U+r+0P4LX j1IthlRd/nw1cDD7NiCdcRjHLBqS8initrb/A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B5/c+fQi34KPsAMPhaiCowFFofm6eCzVaUXJz3o9Vw0=; b=LeuG28/9gJF5Kj7R6z44LRqww1Mb0imxCENwbWucPd78rBTWx4grQjs080eqU3DQAU r8JCH3gere8jlYwnGAroGpeaTlj3huhs0z/J2WxyDpMxjETm/EQnmsPhWRD6lamGH9ku zgwTk723LAzbKnc3Tmf50s5k2GAvJnaNuE8R0Vae+Z2ocTJRFB/gZLyF6Qu78YfhJGDy NttnX8r1qxbBfd/8+pTULYAx7B/9klWIYnvZQpaeGBrnfhIRd9Hjcp5WG+4xYldimvZi nHohKRMjGRMeNa/tZITTeCNR3Q/88CPhoscxSqUuSQEpsOp0DUpVGndm8ct+szy3y46Y u1tw== X-Gm-Message-State: AOAM5339qBC9nRmOeVvyN2A4A2EFy+hJu93HGlklp/qjV5AFyMaq0895 LDqtq/UXHHmIMubCUuTWoD/coOgcWpUBF7cEXtlPKg== X-Google-Smtp-Source: ABdhPJwOREugYDa0xmlEynkbnh+HpCOsh+w5BBUorCApE40LgeIiidvgYNRBytmwhdCeZvaybqRA0lSfNxCLDBwXKKA= X-Received: by 2002:ac8:479a:: with SMTP id k26mr6436224qtq.119.1626393772467; Thu, 15 Jul 2021 17:02:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Clem Cole Date: Thu, 15 Jul 2021 20:02:41 -0400 Message-ID: To: "Nelson H. F. Beebe" Content-Type: multipart/alternative; boundary="00000000000012bacd05c7324ff1" Subject: Re: [TUHS] head/sed/tail (was The Unix shell: a 50-year view) X-BeenThere: tuhs@minnie.tuhs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: The Unix Heritage Society mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: tuhs@minnie.tuhs.org Errors-To: tuhs-bounces@minnie.tuhs.org Sender: "TUHS" --00000000000012bacd05c7324ff1 Content-Type: text/plain; charset="UTF-8" Nelson thanks. Excellent bit of snooping. I wonder why Jay did his version? Maybe he wanted a more modern C features since the Snyder compiler would been based on a very early C dialect. Steve Johnson do you have any insight? As I understand it, Alan started his work by rewritting your Honeywell B compiler to be a C compiler when the C language was quite young and many features we take for granted were not yet created. Clem On Thu, Jul 15, 2021 at 6:26 PM Nelson H. F. Beebe wrote: > Clem Cole asks: > > >> Did you know that before PCC the 'second' C compiler was a PDP-10 > >> target Alan Snyder did for his MIT Thesis? > >> [https://github.com/PDP-10/Snyder-C-compiler] > > I was unaware of that compiler until sometime in the 21st Century, > long after our PDP-10 was retired on 31-Oct-1990. > > The site > > https://github.com/PDP-10/Snyder-C-compiler/tree/master/tops20 > > supplies a list of some of Snyder's files, but they don't match > anything in our TOPS-20 archives of almost 180,000 files. > > I then looked into our 1980s-vintage pcc source tree and compared > it with a snapshot of the current pcc source code taken three > weeks ago. The latter has support for these architectures > > aarch64 hppa m16c mips64 pdp11 sparc64 > amd64 i386 m68k nova pdp7 superh > arm i86 mips pdp10 powerpc vax > > and the pdp10 directory contains these files: > > CVS README code.c local.c local2.c macdefs.h order.c table.c > > All 5 of those *.c files are present in our TOPS-20 archives. I then > grepped those archives for familiar strings: > > % find . -name '*.[ch]' | sort | \ > xargs egrep -n -i > 'scj|feldman|johnson|snyder|bell|at[&]t|mit|m.i.t.' > ./code.c:8: * Based on Steve Johnson's pdp-11 version > ./code2.c:19: * Based on Steve Johnson's pdp-11 version > ./cpp.c:1678: stsym("TOPS20"); /* for > compatibility with Snyder */ > ./local.c:4: * Based on Steve Johnson's pdp-11 version > ./local2.c:4: * Based on Steve Johnson's pdp-11 version > ./local2.c:209: case 'A': /* emit a label */ > ./match.c:2: * match.c - based on Steve Johnson's pdp11 version > ./optim.c:318: * Turn > 'em into regular PCONV's > ./order.c:5: * Based on Steve Johnson's pdp-11 version > ./pftn.c:967: * fill out previous word, to > permit pointer > ./pftn.c:1458: register commflag = 0; /* flag for > labelled common declarations */ > ./pftn2.c:1011: * fill out previous word, to > permit pointer > ./pftn2.c:1502: register commflag = 0; /* flag for > labelled common declarations */ > ./reader.c:632: p2->op = NOASG p2->op; /* this was > omitted in 11 & /6 !! */ > ./table.c:128: " movei A1,1\nZN", /* ZN = > emit branch */ > ./xdefs.c:13: * symbol table maintainence > > Thus, I'm confident that Jay's work was based on Steve Johnson's > compiler, rather than Alan Snyder's. > > Norman Wilson asks: > > >> ... > >> How did that C implementation handle ASCII text on the DEC-10? > >> Were it a from-scratch UNIX port it might make sense to store > >> four eight- or nine-bit bytes to a word, but if (as I sense it > >> was) it was C running on TOPS-10 or TOPS-20, it would have had > >> to work comfortably with DEC's convention of five 7-bit characters > >> (plus a spare bit used by some programs as a flag). > >> ... > > Our pcc compiler treated char* as a pointer to 7-bit ASCII strings, > stored in the top 35 bits of a word, with the low-order bit normally > zero; a 1-bit there meant that the word contained a 5-digit line > number that some compilers and editors would report. Of course, that > low-order non-character bit meant that memset(), memcpy(), and > memmove() had somewhat dicey semantics, but I no longer recall their > specs. > > kcc later gave us access to the PDP-10's 1- to 36-bit byte > instructions. > > For text processing, 5 x 7b + 1b bits matched the conventions for all > other programming languages on the PDP-10. When it came time to > implement NFS, and exchange files and data with 32-bit-word machines, > we needed the ability to handle files of 4 x 8b + 4b and 9 x 8b (in > two 36-bit words), and kcc provided that. > > The one's-complement 36-bit Univac 1108 machines chose instead to > store text in a 4 x 9b format, because that architecture had > quarter-word load/store instructions, but not the general variable > byte instructions of the PDP-10. Our campus had an 1108 at the > University of Utah Computer Center, but I chose to avoid it, because > it was run in batch mode with punched cards, and never got networking. > By contrast, our TOPS-20, BSD, RSX-11, SunOS, and VMS systems all had > interactive serial-line terminals, and there was no punched card > support at all. > > > ------------------------------------------------------------------------------- > - Nelson H. F. Beebe Tel: +1 801 581 5254 > - > - University of Utah FAX: +1 801 581 4148 > - > - Department of Mathematics, 110 LCB Internet e-mail: > beebe@math.utah.edu - > - 155 S 1400 E RM 233 beebe@acm.org > beebe@computer.org - > - Salt Lake City, UT 84112-0090, USA URL: > http://www.math.utah.edu/~beebe/ - > > ------------------------------------------------------------------------------- > -- Sent from a handheld expect more typos than usual --00000000000012bacd05c7324ff1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Nelson thanks.=C2=A0 Excellent bit of snooping.=C2=A0 I w= onder why Jay did his version? =C2=A0 =C2=A0 Maybe he wanted a more modern = C features since the Snyder compiler would been based on a very early C dia= lect. =C2=A0

Steve Johns= on do you have any insight? =C2=A0=C2=A0
As I unders= tand it, Alan started his work by rewritting your Honeywell B compiler to b= e a C compiler when the C language was quite young and many features we tak= e for granted were not yet created. =C2=A0

<= /div>
Clem

On Thu, Jul 15, 2021 at 6:26 PM Nelson H. F= . Beebe <beebe@math.utah.edu&= gt; wrote:
Clem Cole asks:

>> Did you know that before PCC the 'second' C compiler was a= PDP-10
>> target Alan Snyder did for his MIT Thesis?
>> [https://github.com/PDP-10/Snyder-C-compiler= ]

I was unaware of that compiler until sometime in the 21st Century,
long after our PDP-10 was retired on 31-Oct-1990.=C2=A0

The site

=C2=A0 =C2=A0 =C2=A0 =C2=A0 https://gi= thub.com/PDP-10/Snyder-C-compiler/tree/master/tops20

supplies a list of some of Snyder's files, but they don't match
anything in our TOPS-20 archives of almost 180,000 files.

I then looked into our 1980s-vintage pcc source tree and compared
it with a snapshot of the current pcc source code taken three
weeks ago.=C2=A0 The latter has support for these architectures

=C2=A0 =C2=A0 =C2=A0 =C2=A0 aarch64=C2=A0 hppa=C2=A0 m16c=C2=A0 mips64=C2= =A0 pdp11=C2=A0 =C2=A0 sparc64
=C2=A0 =C2=A0 =C2=A0 =C2=A0 amd64=C2=A0 =C2=A0 i386=C2=A0 m68k=C2=A0 nova= =C2=A0 =C2=A0 pdp7=C2=A0 =C2=A0 =C2=A0superh
=C2=A0 =C2=A0 =C2=A0 =C2=A0 arm=C2=A0 =C2=A0 =C2=A0 i86=C2=A0 =C2=A0mips=C2= =A0 pdp10=C2=A0 =C2=A0powerpc=C2=A0 vax

and the pdp10 directory contains these files:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 CVS=C2=A0 README=C2=A0 code.c=C2=A0 local.c=C2= =A0 local2.c=C2=A0 macdefs.h=C2=A0 order.c=C2=A0 table.c

All 5 of those *.c files are present in our TOPS-20 archives.=C2=A0 I then<= br> grepped those archives for familiar strings:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 % find . -name '*.[ch]' | sort | \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0xargs egrep -n -i &#= 39;scj|feldman|johnson|snyder|bell|at[&]t|mit|m.i.t.'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./code.c:8: * Based on Steve Johnson's pdp-= 11 version
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./code2.c:19: * Based on Steve Johnson's pd= p-11 version
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./cpp.c:1678:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0stsym("TOPS20");=C2=A0 =C2=A0 =C2=A0 =C2=A0 /* for compati= bility with Snyder */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./local.c:4: * Based on Steve Johnson's pdp= -11 version
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./local2.c:4: * Based on Steve Johnson's pd= p-11 version
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./local2.c:209:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0case 'A':=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= /* emit a label */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./match.c:2: * match.c - based on Steve Johnson= 's pdp11 version
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./optim.c:318:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0* Turn 'em into regular= PCONV's
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./order.c:5: * Based on Steve Johnson's pdp= -11 version
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./pftn.c:967:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * fill out previous word, to permit poi= nter
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./pftn.c:1458:=C2=A0 register=C2=A0 =C2=A0 =C2= =A0 =C2=A0 commflag =3D 0;=C2=A0 /* flag for labelled common declarations *= /
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./pftn2.c:1011:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 * fill out previous word, to permit pointer=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./pftn2.c:1502: register=C2=A0 =C2=A0 =C2=A0 = =C2=A0 commflag =3D 0;=C2=A0 /* flag for labelled common declarations */ =C2=A0 =C2=A0 =C2=A0 =C2=A0 ./reader.c:632:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0p2->op =3D NOASG p2->op;=C2=A0 =C2=A0 =C2=A0/* this was omitted in= 11 & /6 !! */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./table.c:128:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 "=C2=A0 =C2=A0 =C2=A0 =C2=A0movei=C2=A0 =C2=A0A1,1\nZN",=C2= =A0 =C2=A0 =C2=A0 /* ZN =3D emit branch */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ./xdefs.c:13: * symbol table maintainence

Thus, I'm confident that Jay's work was based on Steve Johnson'= s
compiler, rather than Alan Snyder's.

Norman Wilson asks:

>> ...
>> How did that C implementation handle ASCII text on the DEC-10?
>> Were it a from-scratch UNIX port it might make sense to store
>> four eight- or nine-bit bytes to a word, but if (as I sense it
>> was) it was C running on TOPS-10 or TOPS-20, it would have had
>> to work comfortably with DEC's convention of five 7-bit charac= ters
>> (plus a spare bit used by some programs as a flag).
>> ...

Our pcc compiler treated char* as a pointer to 7-bit ASCII strings,
stored in the top 35 bits of a word, with the low-order bit normally
zero; a 1-bit there meant that the word contained a 5-digit line
number that some compilers and editors would report.=C2=A0 Of course, that<= br> low-order non-character bit meant that memset(), memcpy(), and
memmove() had somewhat dicey semantics, but I no longer recall their
specs.

kcc later gave us access to the PDP-10's 1- to 36-bit byte
instructions.

For text processing, 5 x 7b + 1b bits matched the conventions for all
other programming languages on the PDP-10.=C2=A0 When it came time to
implement NFS, and exchange files and data with 32-bit-word machines,
we needed the ability to handle files of 4 x 8b + 4b and 9 x 8b (in
two 36-bit words), and kcc provided that.

The one's-complement 36-bit Univac 1108 machines chose instead to
store text in a 4 x 9b format, because that architecture had
quarter-word load/store instructions, but not the general variable
byte instructions of the PDP-10.=C2=A0 Our campus had an 1108 at the
University of Utah Computer Center, but I chose to avoid it, because
it was run in batch mode with punched cards, and never got networking.
By contrast, our TOPS-20, BSD, RSX-11, SunOS, and VMS systems all had
interactive serial-line terminals, and there was no punched card
support at all.

---------------------------------------------------------------------------= ----
- Nelson H. F. Beebe=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 Tel: +1 801 581 5254=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 -
- University of Utah=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 FAX: +1 801 581 4148=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 -
- Department of Mathematics, 110 LCB=C2=A0 =C2=A0 Internet e-mail: beebe@math.utah.edu= =C2=A0 -
- 155 S 1400 E RM 233=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0beebe@acm.org=C2=A0 beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA=C2=A0 =C2=A0 URL: http://www.ma= th.utah.edu/~beebe/ -
---------------------------------------------------------------------------= ----
--
Sent from a handheld expect more typos t= han usual
--00000000000012bacd05c7324ff1--