Article View: alt.folklore.computers
Article #317Re: CDC 6600 infection
From: fu... Mark Fulk
Date: Thu, 14 Dec 1989 06:45
Date: Thu, 14 Dec 1989 06:45
38 lines
2211 bytes
2211 bytes
Out of respect to a much admired friend, I should point out that Jacob Schwartz is more famous for his great contributions to mathematics and computer science than for a old programming trick. And, come to think of it, I'm not sure that he's the one responsible for the trick; I heard it that way once, but I now recall someone telling me I had it wrong. If you haven't heard this one, you're probably wondering what it's about. On 6600's you loaded and stored X registers by loading A registers with the addresses; if you loaded A0, X0 got stored; if you loaded A1 to A4, the corresponding X got loaded. To store an A register, you moved it to a free X register; to load it, you got the address into an X register. So X0 (I may have which registers did what a bit wrong; it's been ten years) mostly had to be kept empty. Now suppose you're writing an interrupt routine (not common; the PP's took care of the I/O); you need to save the registers. But you have no right to assume that any register is free. Later 6600's had the exchange jump (XJ) instruction to deal with that case, but not the one at Courant. How do you get X0 free so you can save registers? Answer: Branch to A1 on X0 negative store 0 at location c1 Branch to B1 A1 store 1 at location c1 B1 Shift X0 left Branch to A2 on X0 negative store 0 at location c2 Branch to B2 A2 store 1 at location c2 ..... 58 more times. Save the rest of the registers. Reconstruct X0 from c1-c60. Store it. This is my memory of what I was told by various friends. Anyone with more direct knowledge, please correct me where I'm wrong. Mark
Technical Details
Message-ID:
<1989Dec14.064508.17774@cs.rochester.edu>Path:
mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!udel!rochester!fulkReferences:
<1989Dec14.062403.16907@cs.rochester.edu>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!gmdzi!unido!mcsun!uunet!wuarchive!udel!rochester!fulk From: fu...@cs.rochester.edu (Mark Fulk) Newsgroups: alt.folklore.computers Subject: Re: CDC 6600 infection Message-ID: <1989Dec14.064508.17774@cs.rochester.edu> Date: 14 Dec 89 06:45:08 GMT References: <1989Dec14.062403.16907@cs.rochester.edu> Reply-To: fu...@cs.rochester.edu (Mark Fulk) Organization: University of Rochester Computer Science Department Lines: 38 Posted: Thu Dec 14 07:45:08 1989 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit