Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!zaphod.mps.ohio-state.edu!sdd.hp.com!ucsd!orion.oac.uci.edu!ucivax!baxter From: baxter@zola.ics.uci.edu (Ira Baxter) Newsgroups: comp.arch Subject: Odd word size? Word size? Word? Definitely Odd. Summary: Folk seem to have forgotten word mark machines Message-ID: <270CB430.21156@ics.uci.edu> Date: 5 Oct 90 16:26:24 GMT Lines: 75 Nntp-Posting-Host: zola.ics.uci.edu bcc: baxter There has been recent query on machines with word sizes that were not a power of two, related to algorithms that used binary addressing. It has been a long time since I touched an IBM 1620 or 1401, and my memory is a bit fuzzy on the details. Real oldtimers, feel free to correct the fine details. The 1401 was quite similar in style to the 1620, so I'll skip describing it. If I remember right, these machines violate not only the notion of power of two word sizes, but even the notion of word size. The IBM 1620 had a 5-bit "digit", which could represent, using 4 bits, a decimal digit or some special codes, one of which was called a record mark. The 5th bit was called a "mark" bit. Addressing granularity was to the "digit" level. There were no registers (take THAT! mr. optimal register allocator) save some peculiar regions in lower memory that acted like index registers; all operations were memory to memory. One defined an arithmetic data object by using specifying the (decimal!!) address of the least significant digit. The arithmetic data object extended from there thru more significant digits (at successively lower addresses) until a digit was found with the mark bit set. One defined a numeric field at runtime by applying a "SETMARK" instruction at addresses representing Most Significant Digits of areas to be used as numbers, although I think the assembler would arrange this for you automatically. It was fun to "clear core" (by MOVing a single digit number without mark bit to its own address+1) and then enter an add-to-self instruction; this put the machine into an infinite loop adding the digits of the enormous number defined by the complete absence of mark bits. String-class objects worked the opposite way; the lowest address digit was specified, and the object ended when a digit containing a record mark code was found. I think characters were formed by taking pairs of digits. Instructions were 12 digits, a 2 digit opcode, and 2, 5-digit addresses; I think the MSD of the opcode had to have the mark bit set. I forget precisely what happened when you gave an odd-sized string to instructions that printed strings on the console, printer or card punch (Who needs PRINTF? The hardware did it directly!), but the 1620 had lots of entertaining ways of aborting your program, including the infamous "CHECK" light, which froze the machine whenever a malformed instruction, or numeric operand (containing a record mark) was encountered. Earlier 1620s had a multiply instruction which worked by looking up multipler/multiplicand digit pairs in the multiplication table in lower memory. This table had to be loaded correctly before you used multiply. There are apocryphal stories of folk loading the table in such a way that multiplies worked in octal rather than the standard decimal. I don't remember any boolean operations such as AND or XOR. They'd be a bit out place in a decimal machine, certainly out of character. It was amazing easy to enter raw machine code. You could literally type it in on the console terminal or enter via card punch. I spent many enjoyable hours doing this (forgive me, this was the machine on which I learned assembly. The 360 was total surprise!). Anyway, to summarize: You can't talk about word size when you don't have the notion of word. If you insist on a digit as "word size", I can't imagine an odder size than 5 bits. Addresses were all 5 digits and decimal. I don't think I'd try to run an algorithm on this machine that depended fundamentally on powers of two related to word size. I suspect this machine would put a "C" programmer into a rubber room. -- Ira Baxter