Of course. Got it.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Mark Hammack
Sent: Friday, March 4, 2022 12:58 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Jump vs. Branch

Using BRANCH, LABEL would need to be within +4k (x'0FFF') of the
*current* USING.
If you have USING/DROP on each subroutine, LABEL may or may not fall into
that range.  If it does, the program will branch to LABEL and go into lala
land.  If it doesn't, the assembler will throw an error.

Using JUMP, LABEL needs to be +/- 64k (BRC) from the current instruction.
No assembler error but the run time error still exists.

In the case that caused the S0Cx, B LABEL would have been caught by the
assembler.



*Mark*


On Fri, Mar 4, 2022 at 2:39 PM Charles Mills <charl...@mcn.org> wrote:

> It was of the form J *+384 or something like that?
>
> J label would be subject to the same issues as B label.
>
> Or am I missing the point?
>
> Charles
>
>
> -----Original Message-----
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
> On Behalf Of Mark Hammack
> Sent: Friday, March 4, 2022 12:16 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Re: Jump vs. Branch
>
> Agreed wholeheartedly.  However, I ran into a situation recently that MIGHT
> have been caught using branch rather than jump.
>
> It involved copy/paste from one subroutine to another and not changing the
> JUMP address.  In this case, if a BC had been used, the program would have
> received a compile error but with the BCR, it compiled clean and caused a
> S0Cx abend later in production. No guarantees obviously, the target could
> have still been within the 4k base/displacement but using relative branches
> increases the likelihood of a wild branch.
>
> The only things I could come up with involved macros and/or naming
> conventions...and discipline.  At least it wasn't my code, I just had to
> debug it :-).
>
>
>
>
> *Mark*
>
>
> On Fri, Mar 4, 2022 at 1:43 PM Charles Mills <charl...@mcn.org> wrote:
>
> > Amen, brother!
> >
> > I cannot think of a single negative to the relative jumps (other than the
> > small handful of very specific situations where indexing or similar may
> be
> > necessary). The HUGE gain is the savings in base register requirements,
> the
> > total elimination of base-displacement constraints for executable code.
> The
> > elimination of that "oh crap" moment when you make one quick change to a
> > module and find you have now pushed something past the 4K limit, and your
> > quick change turns into a re-engineering project.
> >
> > Charles
> >
> >
> > -----Original Message-----
> > From: IBM Mainframe Assembler List [mailto:
> ASSEMBLER-LIST@LISTSERV.UGA.EDU
> > ]
> > On Behalf Of Seymour J Metz
> > Sent: Friday, March 4, 2022 11:36 AM
> > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> > Subject: Re: Jump vs. Branch
> >
> > My perspective is that there is no way that a branch relative will be
> > slower, and saving a register help me to streamline my code, so there is
> no
> > down side to automatically using branch relative. If I have to support
> > antique boxen I'll dual path inside a macro.
> >
> > But, yes, pipeline preloading should be easier.
> >
> > --
> > Shmuel (Seymour J.) Metz
> > http://mason.gmu.edu/~smetz3
> >
> > ________________________________________
> > From: IBM Mainframe Assembler List [ASSEMBLER-LIST@LISTSERV.UGA.EDU] on
> > behalf of Charles Mills [charl...@mcn.org]
> > Sent: Friday, March 4, 2022 2:27 PM
> > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> > Subject: Re: Jump vs. Branch
> >
> > In theory the branch relative is easier on the pipeline. An old
> > base-displacement branch is dependent on the value of some register,
> which
> > in theory may be subject to the machinations of the fixed point
> arithmetic
> > unit. A relative jump is only dependent on the instruction counter and
> the
> > contents of the instruction itself.
> >
> > Charles
> >
> >
> > -----Original Message-----
> > From: IBM Mainframe Assembler List [mailto:
> ASSEMBLER-LIST@LISTSERV.UGA.EDU
> > ]
> > On Behalf Of Seymour J Metz
> > Sent: Friday, March 4, 2022 10:40 AM
> > To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> > Subject: Re: Jump vs. Branch
> >
> > I don't know why he uses the term indirect; if anything, they're more
> > direct
> > then the old branches. I wouldn't expect them to be more efficient, but
> if
> > you use them for all branches then you can save a register, which can
> avoid
> > otherwise extraneous saves and restores. Unless I have to run on a really
> > old box, I'd use the jump instructions all the time.
> >
>

Reply via email to