Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site petrus.UUCP Path: utzoo!linus!decvax!bellcore!petrus!dan From: dan@petrus.UUCP Newsgroups: net.arch Subject: Re: Strange architecture proposal Message-ID: <289@petrus.UUCP> Date: Tue, 6-Aug-85 09:09:30 EST Article-I.D.: petrus.289 Posted: Tue Aug 6 09:09:30 1985 Date-Received: Wed, 20-Feb-85 07:41:46 EST References: <968@calgary.UUCP> Distribution: net Organization: Bell Communications Research, Inc Lines: 43 > > Any comments on the following idea? > > > Take a machine with bytes, words, longs, etc. - all of sizes which are > a power of two of some basic unit - and which requires such data to be > aligned, with the address of a unit of size 2**N being required to have > N low-order zero bits. > ... > > Here's the idea: Get rid of the MOVEB, MOVEW, MOVEL, etc. instructions > and replace them with a single MOVE instruction, with the type of > unit to be moved determined by the memory address given. Addresses > have a new format, as for instance: > > 0 0 1 A8 A7 A6 A5 A4 A3 A2 > > This example specifies a long operand (four bytes) with address > > A8 A7 A6 A5 A4 A3 A2 0 0 > > In general, the size of an operand is 2**N, where N is the number of > leading zeros in its address. The "actual" address is the bits after > the highest-order one bit, padded with zeros to make it come out the > the right size. In this scheme, the address > This is a neat idea. Perhaps it would be more convenient to put the size encoding bits on the right. The automatic "stride adjustment" feature goes away, but addresses no longer have to be shifted before use, the effects of arithmetic overflow during address computation are less painful, and direct comparison of pointers to objects of different sizes makes a little more sense. Think how much easier it would be to explain this address representation to a freshman computer programming class. An extra machine instruction could be provided for pointer arithmetic with automatic "stride adjustment". I think the main problem with encoding size in addresses is that it would be necessary to override encoded size too often (I guess I don't really know this -- hacking a C compiler to gather statistics is too much work). What kind of machine language would a C compiler generate to access structure members?