Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!mordor!styx!ptsfa!ihnp4!cuae2!ltuxa!we53!sw013b!dj3b1!killer!jfh From: jfh@killer.UUCP Newsgroups: comp.arch Subject: Re: An idea I'm kicking around Message-ID: <786@killer.UUCP> Date: Tue, 21-Apr-87 17:54:37 EST Article-I.D.: killer.786 Posted: Tue Apr 21 17:54:37 1987 Date-Received: Sat, 25-Apr-87 08:21:52 EST References: <12884@watnot.UUCP> Distribution: comp Organization: The Unix(tm) Connection, Dallas, Texas Lines: 27 Summary: Very old idea. Different versions included. Changing JSR/BSR/CALL etc to a save-pc-and-jump instruction is OLD. Probably older than me. The first time I saw it was in IBM land. Correct me if I am wrong about the System 360, bu calls with it used a Branch And Link instruction that did exactly what was described. The PDP-11 family did weird things with JSR. The format was JSR func,reg. The current value of REG was stacked (viola - recursion is born), the current PC is saved in REG, and the address of FUNC is loaded into the PC. Note that JSR FUNC, PC Does exactly what (well, similiar) JSR FUNC does in Vax/MC68000/J-Random Chip. You return with RTS reg, where (unless you are into co-routines or weird results) reg is the same one used in the JSR. The microcode for the RTS instruction moves REG into PC, to restore the return address (note that this is a no-op if REG is PC) and then pops the stack into REG (this is where the return address gets loaded if REG == PC). My favorite uPC of all times is the RCA CDP1802. It was popular (?) long before the 8088, had 16 registers, all 16 bits and was CMOS. The best part was the it was a truely general purpose register machine. Any one register could be made into the PC by some instruction (whose name I forgot), and the SP could also be changed. - John. (jfh@killer.UUCP) Disclaimer: No disclaimer. Whatcha gonna do, sue me?