The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Clem Cole <clemc@ccc.com>
To: Warner Losh <imp@bsdimp.com>
Cc: The Eunuchs Hysterical Society <tuhs@tuhs.org>
Subject: [TUHS] Re: origin of null-terminated strings
Date: Fri, 16 Dec 2022 16:13:05 -0500	[thread overview]
Message-ID: <CAC20D2O-m40zLg62r=+Gm1t6tFLfuy4O4BG3iJj=1uuRXfKpmg@mail.gmail.com> (raw)
In-Reply-To: <CANCZdfpXG2Wdzhwd5uqhetHM4xX6kNk41V3ULBkoEEuzYf7esw@mail.gmail.com>

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

So I went to the oracle on much of DEC history ... -- this explains why Ken
never heard it.



---------- Forwarded message ---------
From: Timothe Litt
Date: Fri, Dec 16, 2022 at 3:40 PM
Subject: Re: Origin of ASCIZ / null terminated char arrays.
To: Clem Cole <clemc@ccc.com>

On 16-Dec-22 15:04, Clem Cole wrote:
Do either of you know when it showed up in DEC assemblers?  I  remember it
in Macro11 and Macro10, but I have to believe it was in the earlier
machines?  So far I have not found a reference to it in any of my PDP-8
stuff (which is small) and I never had the docs for 6, 7 or 9 -- I assume
Al K. has them on bitsavers - so I'm going to go poking around - but I
thought I'd ask you two if you knew.


Ken Thompson says he had never heard of it before, but he never used the
DEC assemblers -- (he wrote their own on the Honeywell originally I
believe). FWIW: B did not use null-terminated char arrays originally, but
by the time dmr morphed B into newB then C, they had become standard.  Like
many, I had always thought Dennis picked them from the DEC assembler, but
as Ken says - they never really used it.


I was trying to figure out when they (null terminate char arrays) started
to become more standard and specifically the pdeudo OP ASCIZ to create them.


Tx
Clem

It depends on if you require ASCII, or just character strings terminated by
a stop code...
The -11 has .asciz (as does VMS Macro,...); the -10 has ASCIZ.  SIXBIT 0 is
a space, so you needed to know the length, oftentimes in words, so strip
trailing 00s.
The basic 8 assembler (PAL) didn't even have ASCII data.
http://www.bitsavers.org/pdf/dec/pdp8/software/DEC-08-ASAC-D_PAL-III_Symbolic_Assembler_Programming_Manual.pdf

Macro-8 does; the TEXT pseudo-op uses 00 as a stop code.  (It also uses a
6-bit ASCII code).  " is a single character ASCII constant, but not used
for strings.
https://www.grc.com/pdp-8/docs/macro-8_programming_manual.pdf

The -15 has .ASCII and .SIXBIT, but no .ASCIZ.

http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp15/DEC-15-AMZA-D_MACRO15.pdf

Probably of most interest to the Unix history, the PDP-7 assembler's TEXT
pseudo-op 'in order to separate the string from other data following it, a
termination code determined by the character mode is inserted automatically
after the last character code of the string"/...

http://www.bitsavers.org/pdf/dec/pdp7/PDP-7_AsmMan.pdf
I don't remember and/or didn't use the earlier assemblers, but many of the
manuals are on bitsavers.
Both NUL and RUBOUT (a.k.a. DELETE) were used as fill characters to cover
the time teletypes take to execute <CR> and <LF>.  you couldn't represent
the NUL version with ASCIZ, and RUBOUT was picked for the ability to
overpunch paper tape typos.  Neither function, nor the use of NUL as an end
of string marker  is in the ASCII standard, IIRC.

ᐧ

> ᐧ

[-- Attachment #2: Type: text/html, Size: 5920 bytes --]

  reply	other threads:[~2022-12-16 21:15 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  3:02 [TUHS] " Douglas McIlroy
2022-12-16  3:14 ` [TUHS] " Ken Thompson
2022-12-16  9:13   ` Dr Iain Maoileoin
2022-12-16 13:42     ` Dan Halbert
2022-12-16 16:10       ` Dan Cross
2022-12-16 16:22         ` Tom Lyon
2022-12-16 16:29         ` Jon Steinhart
2022-12-16 20:12     ` Dave Horsfall
2022-12-16 21:02       ` Warner Losh
2022-12-16 21:13         ` Clem Cole [this message]
2022-12-16 21:49           ` Clem Cole
2022-12-17  0:26             ` Phil Budne
2022-12-16 21:18         ` Luther Johnson
2022-12-16 21:20         ` Dan Halbert
2022-12-16  3:17 ` Steve Nickolas
2022-12-16 17:24 ` John P. Linderman
     [not found] ` <6009124d-750d-365e-a424-ec7bb25922b9@gmail.com>
2022-12-16 22:30   ` [TUHS] Terms for string, and similar character constructs (was: origin of null-terminated strings) Alejandro Colomar
2022-12-16 22:51     ` [TUHS] " Dave Horsfall
2022-12-16 22:26 [TUHS] Re: origin of null-terminated strings Douglas McIlroy
2022-12-17  2:03 ` James Frew
2022-12-17  3:42 ` steve jenkin
2022-12-17 17:11 ` Clem Cole
2022-12-17 18:15   ` Tom Lyon
2022-12-17 18:43     ` Clem Cole
2022-12-17 18:46       ` Clem Cole
2022-12-17 19:26     ` Tom Perrine
2022-12-19  4:26     ` Adam Thornton
2022-12-16 23:11 Noel Chiappa

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='CAC20D2O-m40zLg62r=+Gm1t6tFLfuy4O4BG3iJj=1uuRXfKpmg@mail.gmail.com' \
    --to=clemc@ccc.com \
    --cc=imp@bsdimp.com \
    --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).