Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!mordor!sri-spam!sri-unix!hplabs!pesnta!peora!ucf-cs!novavax!houligan!dave@murphy.UUCP From: dave@murphy.UUCP (H. Munster) Newsgroups: comp.lang.c Subject: machines with oddball char * formats Message-ID: <177@houligan.UUCP> Date: Thu, 13-Nov-86 08:58:44 EST Article-I.D.: houligan.177 Posted: Thu Nov 13 08:58:44 1986 Date-Received: Sun, 16-Nov-86 20:20:09 EST Organization: Gould Electronics, Ft. Lauderdale, Florida. Lines: 37 I can think of one, from my college days: the Univac 1100 mainframes. I have never seen an implementation of C on one of these, but I can make a few guesses at what it would have to do for that architecture. First of all, the machine uses a 36-bit word size. Normally, addressing is done in words; a pointer to a word is a 36-bit type (of which only 18 bits are normally used, but let's not worry about that). However, to address anything smaller than a word, a wierd "byte pointer" format is used; this format has an 18-bit word address field, a 3-bit field that somehow indicates what part of the word to use (the relationship between the value in this field and the indicated byte isn't clear to me at all), a field that indicates the byte size, and a couple of other bits whose functions I don't remember but which would probably not be needed. So, if short is 18 bits and char is 9 bits, you would have three formats of pointers: ordinary word addresses for ints, floats, and other word- aligned things, a byte pointer format for shorts, and another byte ptr format for chars. (They also have a 12-bit size, but I can't think of any good use for it.) A C compiler implemented in this way would have to do a lot of pointer conversions! Not only that, but it isn't even *possible* to cast a short or char ptr into an int ptr if the address pointed to is not on a word boundary. I would like to hear from anyone who has used an actual C compiler on one of these beasts to see if they work like what I described above. --- It's been said by many a wise philosopher that when you die and your soul goes to its final resting place, it has to make a connection in Atlanta. Dave Cornutt, Gould Computer Systems, Ft. Lauderdale, FL UUCP: ...{sun,pur-ee,brl-bmd}!gould!dcornutt or ...!ucf-cs!novavax!houligan!dcornutt ARPA: wait a minute, I've almost got it... "The opinions expressed herein are not necessarily those of my employer, not necessarily mine, and probably not necessary."