The descriptor was part of the implementation, not part of the language.

--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@listserv.uga.edu> on behalf 
of Robin Vowels <robi...@dodo.com.au>
Sent: Thursday, February 1, 2018 10:09 PM
To: ASSEMBLER-LIST@listserv.uga.edu
Subject: Re: Fair comparison C vs HLASM

From: "Paul Raulerson" <paul.rauler...@me.com>
Sent: Friday, February 02, 2018 12:55 AM


> And as already been noted, C was first compile on a PDP-7, which had a simple 
> instruction set but
> was most definitely a CISC machine too.  ;)

> 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.

And PL/I strings, which used a descriptor in which the length up to 32767
was specified.

> Pascal string length was obviously limited by the max value of a byte -

The length was not embedded in the langage; it was an arbitrary limit
imposed by the implementer.
They could have, for example, used 2 bytes at the start of the string.

> null terminated strings could be just about any possible size.

Yes, but with two disadvantages -- 1. if you wanted to know the length
of the string, it was necessaary to search the entire string.
2. A byte of zero could not be part of the string -- completely
useless when processing arbitrary data (such as image data,
and compressed data).

>  Record eliminators of course, are an entirely different thing,
> but a C string could easily be a few thousand bytes long.
> Handy indeed for things like text processing, which is what the AT&T
> guys were selling Unix and C to their bosses for.


---
This email has been checked for viruses by Avast antivirus software.
https://secure-web.cisco.com/1aDPxzoB6XT6tDTG2XCN51vxrZjtl-UqxQz7Y3L-Y6b9aduYaVJ61OZHLBqWo8Vzg9UzaUzp8dQ0fBzbSV4Cl3A8192WYRIzDEqQUZpENM9Col3WaafoViCOjKJ2T_xZciM85PvFsW2KJYLSBuk1QDqr8TRXKM50_NOAViJtdkQrFpw-3XJNa10phD6k_bmX3ZgVwDQt37AEFqCM6B6kh1CyoVgJHNf30-gB3pjbpogUpBxmcLwvOE1pTV_N0HcAgOgRarc5g_wuVxkVe6C2Gl0qua9B8CNK--CAwx80-JHxfpi_5nC7T7K1wOHQ5tSyoA0dEbcqDS3AK-uTAPZzvVG4szc1QGKwtiTLX-1itIyIZZOtL9L0xLODC5X_WMHoM_7Xgqu9seOtXnlH1WK9HAQ/https%3A%2F%2Fwww.avast.com%2Fantivirus

Reply via email to