Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: Notesfiles $Revision: 1.7.0.10 $; site ccvaxa Path: utzoo!watmath!clyde!cbosgd!ihnp4!inuxc!pur-ee!uiucdcs!ccvaxa!aglew From: aglew@ccvaxa.UUCP Newsgroups: net.arch Subject: ORed indexes Message-ID: <5100066@ccvaxa> Date: Mon, 21-Apr-86 18:36:00 EST Article-I.D.: ccvaxa.5100066 Posted: Mon Apr 21 18:36:00 1986 Date-Received: Wed, 23-Apr-86 21:48:03 EST Lines: 42 Nf-ID: #N:ccvaxa:5100066:000:2313 Nf-From: ccvaxa.UUCP!aglew Apr 21 17:36:00 1986 Another attempt to make life interesting: How would you react to an instruction set that had no indexed addressing mode, but did have a mode where a register was ORed into the address? I can vaguely recall having seen such a beast - is anyone familiar with it? I laughed then, but now I can see arguments for providing such an ORed index addressing mode, in the lack of true indexing. First off, ABSOLUTE and REGISTER INDIRECT are a logically sufficient set of addressing modes. You don't really need indexing. You might want to get rid of indexing because it requires an addition, which requires carry propagation, which slows up the basic memory access cycle, even though ABSOLUTE and REGISTER INDIRECT don't need the add. Now, indexing is used in two distinct ways: accessing arrays, and accessing fields in structures. Losing indexing for array accesses isn't too bad, since just about every expensive array operation can be written using pointers instead of indexes (post-increment doesn't require a carry to perform a memory address). Access to fields in structures, however, doesn't suit pointer arithmetic quite so nicely, since it is much more random. And structures are VERY important in an operating system like UNIX. So what can you do? Adding an index register in slows down the rest of your instruction set, but you do want a way to offset a short distance from a pointer to form the address of a field in a struct, without incurring a large carry delay. Well, you can always just stop the carry from propagating past a certain point. Don't we all love the 8086? Actually, it's not that bad - pointers can be an arbitrary size, you'd just have to ensure that no structure overlaps the segment boundary determined by the point at which you stop propagating the carry. `calloc' can do that. The other option would be to use a carry-less function like OR. ORed indexes would only really be useful for structures that are a power of two in size, but there are a lot of those - and, if memory is cheap, you might be willing to pad out a lot more of your structures, to get a speed increase. Well, there you have it: ORed indexes. Tell me I'm brain damaged. Andy "Krazy" Glew. Gould CSD-Urbana. USEnet: ihnp4!uiucdcs!ccvaxa!aglew 1101 E. University, Urbana, IL 61801 ARPAnet: aglew@gswd-vms