From: "IBM Mainframe Assembler List" <ASSEMBLER-LIST@LISTSERV.UGA.EDU> To:<ASSEMBLER-LIST@LISTSERV.UGA.EDU> Cc: Sent:Fri, 2 Feb 2018 00:49:57 -0600 Subject:Re: Pascal (was : comparison C vs HLASM)
> On Feb 1, 2018, at 9:13 PM, Robin Vowels <robi...@dodo.com.au> wrote: > >> From: "Paul Gilmartin" <00000014e0e4a59b-dmarc-requ...@listserv.uga.edu> >> Sent: Friday, February 02, 2018 2:16 AM > > >> On 2018-02-01, at 06:55:29, Paul Raulerson wrote: >> >>> It also explains one of the reasons why strings in C are null terminated. There were two modes of thought back in those days, ‘Pascal’ strings, which have the string size encoded in a single byte at the start of the string, and ‘C’ strings, which terminate a string with a NULL. >> >>> Pascal string length was obviously limited by the max value of a byte ... >> >>> Who made that moronic "single byte" rule!? > >> The implementer. > A few very smart implementors actually. :) >> o It should be two pointers, first byte and last byte + 1. > > The address of the start of the string and the length are probably better. In machines with 4K of memory or less? Indeed. As we have said, substrings require only a pointer (an address) and a length (one or two bytes), resulting in considerable saving of memory. > Well, a PDP-7 had 18bit word lengths, and that 4K was in words. > I think it was about $70K for a PDP-7 in those days, The DEUCE, with 384 words of memory, ran ALGOL. The drum was 8192 words. > wire wrapped beastie that it was. Engineering changes were made with wire wrap tools. > And yet, a full multi-user UNIX ran on the thing, with a C compiler that could compile itself. That’s amazing… >>> o And having the length contiguous meant that substrings >>> could not be created without copying. > >> Indeed. > >> It's startling how difficult it can be to shift paradigm >> beyond "two modes of thought" and invent another. > >> BTW, those "'Pascal' strings" were not in Wirth's specification >> of Pascal; they came later with, e.g. UCSD. > Actually - they were there on ancient old C/PM machines. PIP PIP and all that. > What actually does amaze me is that anyone would call what those people did “Moronic”. > It makes me seriously wonder.