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: <787@killer.UUCP> Date: Tue, 21-Apr-87 18:26:13 EST Article-I.D.: killer.787 Posted: Tue Apr 21 18:26:13 1987 Date-Received: Sat, 25-Apr-87 08:22:04 EST References: <12884@watnot.UUCP> <1061@aw.sei.cmu.edu> Distribution: comp Organization: The Unix(tm) Connection, Dallas, Texas Lines: 49 Summary: What?, no thanks to DEC for the Vax? In article <1061@aw.sei.cmu.edu>, firth@sei.cmu.edu (Robert Firth) writes: > The machines I've liked best stored the return link in a register. Not > just for that reason; in addition they have both been very clean pieces > of hardware (thanks, Perkin-Elmer, for the PE3200; thanks, MIPS, for MIPS), > but one aspect of that cleanliness is that they don't try to tell > language implementors how to think. > > You definitely have my vote for using a register. > > Another issue is the right operand of the JSR. Most machines seem to > use the "effective address" as the operand, so whereas LOAD F will fetch > the VALUE in F, JSR F will jump to the ADDRESS of F. I have never liked > this. You lose nothing, and gain a lot, by evaluating the operand in > Rmode, so that JSR #F calls F, JSR F calls the thing pointed to by F, > and JSR Reg calls the thing whose value has been computed in the register. > But this is an eccentric view. I read someone's complaint about the vax CALLS/CALLG instructions in an article I read after posting my reply to the original article, so I apologize for posting again. DEC has been doing things the *right* way since the early 70's with the PDP-11 and later with the Vax. JSR on a PDP-11 saves the return address in a register. JSR on a Vax (same for a PDP-11, but the Vax has more and harder to figure out modes :-) takes a dozen or so addressing modes (the illegal ones are the most fun (what does JSR (R15) _really_ do?) Trivia question - what does TSTW -(R15) do and is it legal? Other thoughts I thought of... Motorola does what DEC does (kinda) with the M68000 family. Except for the abundance of modes. JMP (A0,D0) is my favorite code to generate for switch's and JSR (A0,D0) probably has some equally handy usages (like device or file system switches (see "Unlinking "." in comp.bugs.sys5)). Yes, I am all for saving the return address in a register, makes interpreters and such much easier - co-routines and other non-standard constructions work much better also. I am also for having a way to stack the return address automatically (And Guy Harris thought the PDP-11 was really dead ... Here is yet another not-yet-dead feature ...) The only problem with the DEC approach is that it can't be pipelined too much since the branch address and the old PC may both want to be loaded into the PC at the same time. Of course, this is a problem with the uCode coder. - John. (jfh@killer.UUCP) Disclaimer: No disclaimer. Whatcha gonna do, sue me?