🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.arch
Article #13512

Re: An idea I'm kicking around

#13512
From: greg
Date: Mon, 27 Apr 1987 22:32
35 lines
2241 bytes
In article <1061@aw.sei.cmu.edu> firth@bd.sei.cmu.edu.UUCP (Robert Firth) writes:
>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.

You do lose something. If the 68000 JSR worked this way, e.g., there
would be no way to JSR relative to the PC. JMP is effectively
LEA <address>,PC and JSR is the same thing with a push. So do you think
LEA is useless?

Even if you don't need a PC-relative address, it is often more efficient
than an absolute one.

So what do you gain? Of course you can indirect one level further,
but does that gain you a lot? It doesn't with CISC addressing modes,
anyway.

The PDP-11 provides other jump options: MOV ...,PC which is an Rmode
jump, and ADD ...,PC which is a relative jump with general-address offset.

As for 'JSR Reg', this is illegal on the 68K and PDP, where it is
replaced for free by 'JSR (Reg)'. The analogous op on an NS32k is
JSR 0(reg), with one byte for the 0, since non-indexed register indirection
is not provided. You can say JSR reg, which is the same thing for
different reasons: a register in an address context is assumed to
contain the address.

-- 
----------------------------------------------------------------------
Greg Smith     University of Toronto      UUCP: ..utzoo!utcsri!greg
Have vAX, will hack...
Technical Details
Message-ID: <4684@utcsri.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utcsri!greg
References: <12884@watnot.UUCP> <1061@aw.sei.cmu.edu>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!utcsri!greg
From: greg@utcsri.UUCP
Newsgroups: comp.arch
Subject: Re: An idea I'm kicking around
Message-ID: <4684@utcsri.UUCP>
Date: Mon, 27-Apr-87 18:32:31 EDT
Article-I.D.: utcsri.4684
Posted: Mon Apr 27 18:32:31 1987
Date-Received: Tue, 28-Apr-87 00:59:57 EDT
References: <12884@watnot.UUCP> <1061@aw.sei.cmu.edu>
Reply-To: greg@utcsri.UUCP (Gregory Smith)
Distribution: comp
Organization: CSRI, University of Toronto
Lines: 35