To get to relative operations, there is an IBM supplied macro that one can include right at the top of your source and it can be turned on/off as needed.

As I recall, it does OPSYN to get rid of based branch (jump) and uses the relative version.

I'm sorry, I'm not doing ALC right at this time, so I'd actually have to go look for that macro, but it does exist and I can't remember where it was that I found that and read up on the ramifications.

Steve Thompson

On 11/9/2023 12:33 PM, Charles Mills wrote:
Principles is your friend!

I found the transition from based to relative to be relatively (ha ha)
painless. You don't have to do it all at once. Just start coding relative
jumps now. The existence of base register does not preclude using relative
jumps. Then when you get comfortable, comment out the USING and see what
happens.

I know I can do a relative jump up to 4K, correct
The programmer answer is Yes. But in addition to up to 4K, you can actually
do up to +/- 65K. There are also even longer ones that will jump anywhere.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]]
On Behalf Of Dave Clark
Sent: Thursday, November 9, 2023 9:17 AM
To: [email protected]
Subject: Based vs. Relative (was: Internal Exit Routine Handling)

"IBM Mainframe Assembler List" <[email protected]> wrote on
11/09/2023 11:27:20 AM:
IMHO, relative branch use is a "best practice" in all situations. I
*never* use a based branch if an equivalent relative branch will
suffice...


         I've been coding based-branches since 1980 and never moved on to
the new stuff.  But I recognize that it would be beneficial if I did.  So,
let me ask a couple of simple questions...

         Is it, relatively speaking (hehe), "a lot" of effort (or even
possible/practical) to do away with a code base register altogether?  The
first place that I would like to switch to relative jumps is in my
structured programming macro sets.  But do relative jumps come in more
than one flavor? ...like long jumps and "how far"?

         I know I can do a relative jump up to 4K, correct?  Is there a
long jump beyond that?  And since there can be as much code between the
macros in my macro sets as the user determines to put in there, should I
use long jumps as opposed to "short" jumps, just-in-case?

         For example...  I have these 4 macros in one of my sets.
Internally, I generate labels for THENnnnn, ELSEnnnn, and ENDFnnnn.  These
also arbitrarily allow nesting up to 8 levels.

IF   condition,AND/OR,condition
AND  condition,AND,condition
   ... as much code as the user desires between here ...
ELSE
   ... as much code as the user desires between here ...
ENDIF


Sincerely,

Dave Clark

Reply via email to