Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!lupine!infopiz!athertn!hpda!hpcupt1!jacka From: jacka@hpcupt1.HP.COM (Jack C. Armstrong) Newsgroups: comp.misc Subject: Re: Looking for Computer Folklore Message-ID: <6540007@hpcupt1.HP.COM> Date: 18 Feb 89 00:57:45 GMT References: <7143@pyr.gatech.EDU> Organization: Hewlett Packard, Cupertino Lines: 31 Maybe this should be under 'Real Programmers', a later entry in these notes, but here goes. Many of these details have been fuzzed by the healing effects of time, so if there are any SDS940 gurus about, they may want to correct me. Long, long ago, in a place not far away (SRI, back when it was STANFORD Research Institute), we had an SDS940 in the Artificial Intelligence Group. I think we had production serial #2 or 3 of these beasts, which were an SDS930 with a Berzerkly hacked paging box, and an even more hacked 'time-sharing' OS. Student slave labor being what it is, there was of course no internal documentation available, but after many long hassles, we were given source. It was entirely in assembler, but source code is self documenting, right? I mean, what other reason to program in anything but raw bits? I loaded a major set of OS source on the system and started to look at the comments columns. You guessed it! Blank. Nada. Frustrated, I set up a search of the entire file and found ONE comment. ONE, in thousands of lines of assembly code! The comment was, and I quote: "Note the clever use of the register exchange instruction." As I recall, the 940 had 3 general purpose registers, and there was an all purpose register exchange instruction, with bits set for source or destination of the move. What they had done was to set the bits to move two of the registers into the remaining one simultaneously! Nothing in the hardware manual indicated what would happen if you did this, and the SDS rep on site stated firmly that it would cause an illegal instruction trap. A few minutes with debug proved that, as a completely accidental side effect of the CPU design, moving two registers into the third caused them to be XORed together! Thus the 'clever use.' I've never liked Berkeley students since!