Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gatech.CSNET Path: utzoo!watmath!clyde!bonnie!akgua!gatech!jeff From: jeff@gatech.CSNET (Jeff Lee) Newsgroups: net.arch Subject: Re: RISC Message-ID: <425@gatech.CSNET> Date: Wed, 3-Jul-85 17:56:40 EDT Article-I.D.: gatech.425 Posted: Wed Jul 3 17:56:40 1985 Date-Received: Fri, 5-Jul-85 03:12:12 EDT References: <639@vax2.fluke.UUCP> <2743@nsc.UUCP> Organization: School of ICS, Georgia Institute of Technology, Atlanta Lines: 34 > > Saving the status register is an infrequent operation; why not do > > multiple conditional branches instead? Virtually no application > > programs need it at all. The operating system just needs it to switch > > contexts, which is a task done infrequently, and takes so much time as > > it is... :-) > > It's not as funny as you think! The old UNIVAC 1107 did just exactly that > to save the status of the carry and overflow flags. And in order to > restore them, it had to actually do an arithmetic sequence that would > force the flags to have the right values. There were *no* instructions to > directly save or restore these flags! And then (moving slightly off the subject) there was the code that was needed to save all your registers on a CDC-6000 type machine. It had an interesting architecture where when you loaded register A1-A5 with a number the corresponding X1-X5 received the contents of that memory location. When you loaded registers A6-A7 with a number the contents of X6-X7 was stored in that location. Registers A0 and X0 were not associated like this. In order to store a register, you had to change an A-register value. As I remember it, the code used one of the index registers (B-registers) and performed a series of 18 conditional Return-Jumps based on the sign of the chosen B-register and shifting it 1 bit to the left at a time. Then it could nuke that B-register and save A6 or A7 in it and start storing values. It then could reconstruct the killed B-register by tracing through the memory locations used as targets for the return jumps. Can you say CONVOLUTED boys and girls?? Needless to say, the software designers decided that if YOU want a register then YOU better save it because they aren't about to save them all. Enjoy, -- Jeff Lee CSNet: Jeff @ GATech ARPA: Jeff%GATech.CSNet @ CSNet-Relay.ARPA uucp: ...!{akgua,allegra,hplabs,ihnp4,linus,seismo,ulysses}!gatech!jeff