Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!sri-unix!hplabs!pyramid!decwrl!labrea!navajo!billw From: billw@navajo.STANFORD.EDU (William E. Westfield) Newsgroups: comp.lang.c Subject: Re: machines with oddball char * formats Message-ID: <1092@navajo.STANFORD.EDU> Date: Mon, 17-Nov-86 15:29:27 EST Article-I.D.: navajo.1092 Posted: Mon Nov 17 15:29:27 1986 Date-Received: Tue, 18-Nov-86 09:21:43 EST References: <1011@zog.cs.cmu.edu> Organization: Stanford University Lines: 36 Summary: the dec20 has several C compilers... Yes, the DEC-20 and DEC-10 computers (the same processor, actually) are word addressable machines, and pointers to bytes smaller than 36 bits have a special format (containing the position within a word, the byte size, and the addres of the word). There are several successfull C compilers for the 20 better than the version of PCC written for it at MIT. There is one from New Mexico, and one from Stanford. A variety of bytes sizes are used for Chars are variously 7, 8 or 9 bits (7 allows efficient text packing 5 chars/word. 8 is what most people writing "portable" code assume a char has. 9 allows structs to be copied using say, cpystr, since it hits all the bits.) Personally, I feel that a mjor weakness of "C" as a "portable" language is its assumtion of byte addressability. here's an except for the stanford tops20 C compiler (KCC) doc: ------ All pointers are a word long. Char pointers (and someday short pointers) are either local or one word global byte pointers to the byte itself (LDB rather than ILDB pointers). Pointers to word and multi-word quantities are simply (global) machine addresses. (char *) of a word pointer (pointer to int, float, struct etc) produces a byte pointer that points to the leftmost 9-bit byte that would have occupied the word pointed to by the int pointer. The exception to this is that (char *) (int *) NULL remains zero. (int *) of a char pointer produces an address that points to the word that the char in which the char pointer is pointed to occupies. Converting a char pointer into an int pointer is slightly slower than the reverse transformation. Again, coercing zero doesn't change it. ----- BillW