Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!sm.unisys.com!ism780c!news From: news@ism780c.isc.com (News system) Newsgroups: comp.arch Subject: Re: String lengths Message-ID: <22036@ism780c.isc.com> Date: 8 Feb 89 21:03:41 GMT References: <8882@alice.UUCP> Reply-To: marv@ism780.UUCP (Marvin Rubenstein) Organization: Interactive Systems Corp., Santa Monica CA Lines: 45 In article <8882@alice.UUCP> dmr@alice.UUCP writes: > More nearly correct >memory--which applies only to 20-year-old implementations >on the IBM 7090 and GE 635/645--says that strings existed >in two forms: a one-byte count followed by the characters >of the string, and an expanded form in which the count >and the characters were blown out into words. > >In these implementations, bytes were 9 bits, and so the compact >representation limited strings to length 511. On the >other hand, the blown-out form occupied lots of space and >wasn't suitable for transferring directly to text files. >Originally, I believe, there were no operators for accessing >individual characters in a compact string, though they were >added later. I cannot speak about the GE 635, But I can speak with some authority about the IBM 7090. I have before me both the 7090 reference manual and the micro code that I wrote to emulate the 7090 on the Standard IC4000. The 7090 provided no instructions for accessing individual characters. The notion of characters existed only at the I/O interface where 6 characters (in 6 bit BCD) could be read into a single 36 bit word. The minimum transfer was two words. I am not aware of any languages made available by IBM that provided a string data type. In fact the limit of 6 character identifiers in FORTRAN was due to the fact that 6 characters could be manipulated as a word on the 7090 (and on the 704 the original "FORTRAN" machine). IBM did produce a 7040 machine (similar to but not an extension of the 7090). This machine provided character load and store. But the use of the facility was limited by the fact that a character address could not be put into an index register. I implemented an extended version of 7090 called the EX02 by Standard Computer that did support strings. Because the words had room in them for two pointers and a character, I represented a string as a linked list with one character per word. The ends of the string was marked by null pointers. There were instructions to traverse the linked list and to convert from a packed array of characters to a string and back again. The language that took advantage of these strings was called IMPLAN (implementation language). An interesting feature of the language was that an expression like i*s, where i was an integer and s was a string, meant the first i charcters of s. And s*i meant the last i characters of the string. Marv Rubinstein