Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Steve Smith
You forgot the 4th, 20-bit based signed displacement (Y & G-suffixed
instructions).  Just to have a chance at misremembering, I think that's
about +/- half a MB.

sas

On Thu, Nov 9, 2023 at 1:33 PM Seymour J Metz  wrote:

> There are  only three sizes:
>
> legacy, 12 bits, unsigned, 4 Ki byts
> relative, 16 bits, signed, +/- 32 Ki HW = +/- 64 Ki bytes
> relative long, 32 bits, signed, +/- 2 Gi HW = +/- 4 Gi bytes
>
> --
> Shmuel (Seymour J.) Metz
> http://mason.gmu.edu/~smetz3
> עַם יִשְׂרָאֵל חַי
>
>


Re: Based vs. Relative

2023-11-09 Thread Farley, Peter
Yes he did – he called it MAKEREL and you can get it here:

http://vmworkshop.org/martin/makerel.zip

The page that file is hosted on can be found here:

http://vmworkshop.org/martin/index.shtml

HTH

Peter

From: IBM Mainframe Assembler List  On Behalf 
Of Ed Jaffe
Sent: Thursday, November 9, 2023 1:37 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Based vs. Relative


On 11/9/2023 10:26 AM, Dave Clark wrote:

>  Thanks, but the IEABRCX macro doesn't exist in the z/VSE world.



ISTR Martin Trübner wrote an equivalent macro for z/VSE.



--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


Re: Internal Exit Routine Handling

2023-11-09 Thread Seymour J Metz
The relative instructions are invaluable for large csects, but in this case I 
believe that they are overkill. All he needs is the judicious placement of DROP.

OTOH, they are definitely instructions worth his time to learn.

-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי




From: IBM Mainframe Assembler List  on behalf 
of Tom Marchant <00a69b48f3bb-dmarc-requ...@listserv.uga.edu>
Sent: Wednesday, November 8, 2023 6:41 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Internal Exit Routine Handling

As Tony mentioned, you can use LARL.
You can also use BRAS (Branch Relative and Save) to call the subroutine.
No base register is needed to reference storage for these, or any of the other 
relative instructions.

--
Tom Marchant


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Dave Clark
"IBM Mainframe Assembler List"  wrote on 
11/09/2023 12:54:36 PM:
> > But in addition to up to 4K, you can actually
> > do up to +/- 65K.
> OK, so the "normal" relative jump is the signed, 16-bit variety 
> mentioned (15-bit relative target with left-most bit as the direction). 
> How is that +/- 65K?  Wouldn't that be +/- 32K?


Ah!  I see!  A little reading revealed that the 16-bit relative 
target is not one-for-one but is the number of halfwords added or 
subtracted from the current address location.  That would double the range 
from a literal +/-32K to an actual +/-64K range.  Thanks!   ;-)


Sincerely,

Dave Clark
-- 
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331





*
This email message and any attachments is for use only by the named 
addressee(s) and may contain confidential, privileged and/or proprietary 
information. If you have received this message in error, please 
immediately notify the sender and delete and destroy the message and all 
copies. All unauthorized direct or indirect use or disclosure of this 
message is strictly prohibited. No right to confidentiality or privilege 
is waived or lost by any error in transmission. 
*


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Seymour J Metz
There are  only three sizes:

legacy, 12 bits, unsigned, 4 Ki byts
relative, 16 bits, signed, +/- 32 Ki HW = +/- 64 Ki bytes
relative long, 32 bits, signed, +/- 2 Gi HW = +/- 4 Gi bytes

-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי




From: IBM Mainframe Assembler List  on behalf 
of Dave Clark 
Sent: Thursday, November 9, 2023 12:54 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Based vs. Relative (was: Internal Exit Routine Handling)

"IBM Mainframe Assembler List"  wrote on
11/09/2023 12:33:58 PM:
> Principles is your friend!

Yes, I will be doing some reading.  But a few quick answers are
helpful.

> But in addition to up to 4K, you can actually
> do up to +/- 65K.

OK, so the "normal" relative jump is the signed, 16-bit variety
mentioned (15-bit relative target with left-most bit as the direction).
How is that +/- 65K?  Wouldn't that be +/- 32K?  Or are there actually
three varieties -- 16-bit, 32-bit, and the "even longer ones" you hinted
at?

Sincerely,

Dave Clark
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331




*
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.
*


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Dave Clark
"IBM Mainframe Assembler List"  wrote on 
11/09/2023 12:53:26 PM:
> I would personally find
>  If condition
>  Then
>  200 lines of code
>  Else
>  150 lines of code
>  End-if
> hard to navigate.


I don't disagree with you.  But if you allow someone to do a thing 
then they just might do it.   ;-)But, now that I know the basic 
relative jump is at least +/- 32K, I don't think I need to allow for more 
than that.  Thanks.


Sincerely,

Dave Clark
-- 
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331





*
This email message and any attachments is for use only by the named 
addressee(s) and may contain confidential, privileged and/or proprietary 
information. If you have received this message in error, please 
immediately notify the sender and delete and destroy the message and all 
copies. All unauthorized direct or indirect use or disclosure of this 
message is strictly prohibited. No right to confidentiality or privilege 
is waived or lost by any error in transmission. 
*


Re: Based vs. Relative

2023-11-09 Thread Tony Harminc
On Thu, 9 Nov 2023 at 12:54, Steve Thompson  wrote:

> 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 find the generated code to be unnecessarily annoying, because it
generates the basic BRC instruction with a numeric condition, rather than
the extended opcode. But it's just ugliness - it works fine. You can write
your own better version.
Just replacing base/displacement BCs in structured macros with relative
BRCs is usually a no-brainer, unless your macro can for some reason
generate a branch table or the like that has explicit base/displacement as
an operand.

If you're using the relative branch instructions directly, do pay attention
to the mnemonics. Gone are the days when an experienced programmer knew
*all* the instruction names and all the abbreviations for the branches.

The basic branch on condition instruction names map easily to relative. In
theory BC, BRC, and BRCL (and of course BCR, but we're not going there) are
all you ever need. But people like the convenience of having the condition
encoded in the mmnemonic rather than having to specify the numeric CC test
value explicitly, e.g. BC 8,... So:

*B/D Rel  RLCond*
BC  BRC  BRCL  -
NOP JNOP JLNOP 0
BO  JO   JLO   1
BH  JH   JLH   2
BL  JL   JLL   4
BE  JE   JLE   8
The above specify just one test bit. But we can have others with more bits
- the most common are the negations of those above, i.e. 15-cond:
B   JJLU  15
BNO JNO  JLNO 14
BNP JNP  JLNP 13
BNM JNM  JLNM 11
BNZ JNZ  JLNZ  7

and there are many more - too many, I think. The thing to watch for is that
you can't just make these up. What's caught some people is writing JLE
thinking it means "Jump on Low or Equal". If you wrote BLE you'd get an
error, but JLE is Jump Long on Equal, and will assemble without error but
is Very Different! Similarly JL is not JLU, but at least this will probably
produce a message if you mistake the two.

There is a complete table in the back of the PofO, and also in the HLASM
reference.

What chance I don't have a typo in the above...? Someone will let me know.

Tony H.


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Tom Marchant
On Thu, 9 Nov 2023 12:54:36 -0500, Dave Clark  wrote:

>"IBM Mainframe Assembler List"  wrote on
>11/09/2023 12:33:58 PM:
>> Principles is your friend!
>
>Yes, I will be doing some reading.  But a few quick answers are
>helpful.
>
Please do. It isn't that hard to look up one instruction (BRC) and read the half
page or so that documents it.
>
>OK, so the "normal" relative jump is the signed, 16-bit variety
>mentioned (15-bit relative target with left-most bit as the direction).
>How is that +/- 65K?  Wouldn't that be +/- 32K?  

As clearly documented in the POO it is +/- 32K halfwords.

>Or are there actually
>three varieties -- 16-bit, 32-bit, and the "even longer ones" you hinted
>at?

The relative long instructions with a 32-bit relative offset allows for 
plus/minus 4GB from the PSW address. You want even longer than that?

-- 
Tom Marchant


Re: Based vs. Relative

2023-11-09 Thread Ed Jaffe

On 11/9/2023 10:26 AM, Dave Clark wrote:

 Thanks, but the IEABRCX macro doesn't exist in the z/VSE world.


ISTR Martin Trübner wrote an equivalent macro for z/VSE.

--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
https://www.phoenixsoftware.com/



This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Gary Weinhold
For the question about use in structuring macros, the first question would be 
is how many concurrent base registers are usually in play; that would help 
determine whether to choose regular or long displacement instructions.

The other consideration is structured code style.  Within an IF-THEN-ELSE 
structure (or even a CASE structure) inplemented in assembler, how much code do 
you really want between structure elements before you really want to imbed the 
code in a out-of-line subroutine using JAS or LARL and BASR  to access it?  I 
would personally find
 If condition
 Then
 200 lines of code
 Else
 150 lines of code
 End-if
hard to navigate.

Gary Weinhold
Senior Application Architect
DATAKINETICS | Data Performance & Optimization
Phone:+1.613.523.5500 x216
Email: weinh...@dkl.com
Visit us online at www.DKL.com
E-mail Notification: The information contained in this email and any 
attachments is confidential and may be subject to copyright or other 
intellectual property protection. If you are not the intended recipient, you 
are not authorized to use or disclose this information, and we request that you 
notify us by reply mail or telephone and delete the original message from your 
mail system.



From: IBM Mainframe Assembler List  on behalf 
of Charles Mills 
Sent: November 9, 2023 12:33
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU 
Subject: Re: Based vs. Relative (was: Internal Exit Routine Handling)

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:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
On Behalf Of Dave Clark
Sent: Thursday, November 9, 2023 9:17 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Based vs. Relative (was: Internal Exit Routine Handling)

"IBM Mainframe Assembler List"  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 THEN, ELSE, and ENDF.  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
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331






*
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.

*


Re: Based vs. Relative

2023-11-09 Thread Steve Thompson
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:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
On Behalf Of Dave Clark
Sent: Thursday, November 9, 2023 9:17 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Based vs. Relative (was: Internal Exit Routine Handling)

"IBM Mainframe Assembler List"  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 THEN, ELSE, and ENDF.  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


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Dave Clark
"IBM Mainframe Assembler List"  wrote on 
11/09/2023 12:33:58 PM:
> Principles is your friend!

Yes, I will be doing some reading.  But a few quick answers are 
helpful.

> But in addition to up to 4K, you can actually
> do up to +/- 65K.

OK, so the "normal" relative jump is the signed, 16-bit variety 
mentioned (15-bit relative target with left-most bit as the direction). 
How is that +/- 65K?  Wouldn't that be +/- 32K?  Or are there actually 
three varieties -- 16-bit, 32-bit, and the "even longer ones" you hinted 
at?

Sincerely,

Dave Clark
-- 
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331




*
This email message and any attachments is for use only by the named 
addressee(s) and may contain confidential, privileged and/or proprietary 
information. If you have received this message in error, please 
immediately notify the sender and delete and destroy the message and all 
copies. All unauthorized direct or indirect use or disclosure of this 
message is strictly prohibited. No right to confidentiality or privilege 
is waived or lost by any error in transmission. 
*


Re: Based vs. Relative

2023-11-09 Thread Paul Gilmartin

On 11/9/23 10:54:39, Steve Thompson wrote:

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.





--
gil


Re: Based vs. Relative

2023-11-09 Thread Dave Clark
"IBM Mainframe Assembler List"  wrote on 
11/09/2023 01:18:37 PM:
> On 11/9/23 10:54:39, Steve Thompson wrote:
> > As I recall, it does OPSYN to get rid of based branch (jump) and 
> uses the relative version.
> >
>  topic=xct-ieabrcx-relative-branch-macro-extension__;!!
> E0nbmg29qrX0lQ!
> 
fM5la5Qkky51NLbVsKXkFMo1UZqEW6ISw8l1woQYjY1GqLFOoDamVPYYB03l25a8Hv1QL_baeJkLgbEGLYRYcQVzSeMGuO968NC1lNs
> $ >


Thanks, but the IEABRCX macro doesn't exist in the z/VSE world.


Sincerely,

Dave Clark
-- 
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331





*
This email message and any attachments is for use only by the named 
addressee(s) and may contain confidential, privileged and/or proprietary 
information. If you have received this message in error, please 
immediately notify the sender and delete and destroy the message and all 
copies. All unauthorized direct or indirect use or disclosure of this 
message is strictly prohibited. No right to confidentiality or privilege 
is waived or lost by any error in transmission. 
*


Re: Internal Exit Routine Handling

2023-11-09 Thread Ed Jaffe

On 11/9/2023 4:06 AM, Seymour J Metz wrote:

The relative instructions are invaluable for large csects, but in this case I 
believe that they are overkill. All he needs is the judicious placement of DROP.

OTOH, they are definitely instructions worth his time to learn.


In addition to extending the practical size of a code segment and 
potentially making additional general-purpose registers available, 
relative branches are also better understood/optimized by the 
branch-prediction circuitry in the hardware since there is no question 
what the final branch target address will be. Furthermore, relative 
branches avoid the AGI suffered by based branches that occurs every time 
a code base register is loaded (or re-loaded).


IMHO, relative branch use is a "best practice" in all situations. I 
*never* use a based branch if an equivalent relative branch will suffice...


--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
https://www.phoenixsoftware.com/



This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.


Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Dave Clark
"IBM Mainframe Assembler List"  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 THEN, ELSE, and ENDF.  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
-- 
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331





*
This email message and any attachments is for use only by the named 
addressee(s) and may contain confidential, privileged and/or proprietary 
information. If you have received this message in error, please 
immediately notify the sender and delete and destroy the message and all 
copies. All unauthorized direct or indirect use or disclosure of this 
message is strictly prohibited. No right to confidentiality or privilege 
is waived or lost by any error in transmission. 
*


Re: Internal Exit Routine Handling

2023-11-09 Thread Seymour J Metz
Given that jumps are no longer than the equivalent branches, that's hard to 
argue with. LAY and LHI are other ones that I would expect to see used a lot, 
possibly more than LARL.




-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי




From: IBM Mainframe Assembler List  on behalf 
of Ed Jaffe 
Sent: Thursday, November 9, 2023 11:27 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Internal Exit Routine Handling

On 11/9/2023 4:06 AM, Seymour J Metz wrote:
> The relative instructions are invaluable for large csects, but in this case I 
> believe that they are overkill. All he needs is the judicious placement of 
> DROP.
>
> OTOH, they are definitely instructions worth his time to learn.

In addition to extending the practical size of a code segment and
potentially making additional general-purpose registers available,
relative branches are also better understood/optimized by the
branch-prediction circuitry in the hardware since there is no question
what the final branch target address will be. Furthermore, relative
branches avoid the AGI suffered by based branches that occurs every time
a code base register is loaded (or re-loaded).

IMHO, relative branch use is a "best practice" in all situations. I
*never* use a based branch if an equivalent relative branch will suffice...

--
Phoenix Software International
Edward E. Jaffe
831 Parkview Drive North
El Segundo, CA 90245
https://secure-web.cisco.com/1EL3QVedrIpZxwM7sZ-eG4OTKZrFwZSVKNvDOpv0LAnPdIeYl0eiWPKhHkTf4Wa-E_U9tiD6Pp6YPt5FhK6Y-5MGD_0ePM4kCT1CHMFsINcD__zwf_7y0Mmw16F-gmHQt_HnbDUNt2d6DwG-nzK7U7X_6WrBQsI6MLDviLk6mH9higY_fcqB71b6d0r7uB4_JEFMuHsDl3II3oJPIXN43sl-7ZqGoNNLNd_9l3J4-RteKw1lmsdNavSGR4ZpXa918K4Y6WUaiA4_B9S_GsO8yvgNVXOiGvE7H1Ct2knUVuPD5qslEyOjWZhYY6ZqLYknkVxa0hReXwXPnM8CkPr8ytMsMkThJwO3pWt_feiB4HSmTPK1RhSDkk1XpFfn-UZ1TRrjk6XZNdSgwPoNHliTzrNXtV2Ag-W7z35ngoZoOgzs/https%3A%2F%2Fwww.phoenixsoftware.com%2F



This e-mail message, including any attachments, appended messages and the
information contained therein, is for the sole use of the intended
recipient(s). If you are not an intended recipient or have otherwise
received this email message in error, any use, dissemination, distribution,
review, storage or copying of this e-mail message and the information
contained therein is strictly prohibited. If you are not an intended
recipient, please contact the sender by reply e-mail and destroy all copies
of this email message and do not otherwise utilize or retain this email
message or any or all of the information contained therein. Although this
email message and any attachments or appended messages are believed to be
free of any virus or other defect that might affect any computer system into
which it is received and opened, it is the responsibility of the recipient
to ensure that it is virus free and no responsibility is accepted by the
sender for any loss or damage arising in any way from its opening or use.



Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Seymour J Metz
Jumps (branch relative) have a 16-bit signed offset; that's a lot of 
addressability. I see no reason to use relative long (32-bit signed) in the 
normal course of events.

-- 
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3
עַם יִשְׂרָאֵל חַי




From: IBM Mainframe Assembler List  on behalf 
of Dave Clark 
Sent: Thursday, November 9, 2023 12:16 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Based vs. Relative (was: Internal Exit Routine Handling)

"IBM Mainframe Assembler List"  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 THEN, ELSE, and ENDF.  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
--
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331





*
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.
*


Re: Based vs. Relative (was: Internal Exit Routine Handling)

2023-11-09 Thread Charles Mills
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:ASSEMBLER-LIST@LISTSERV.UGA.EDU]
On Behalf Of Dave Clark
Sent: Thursday, November 9, 2023 9:17 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Based vs. Relative (was: Internal Exit Routine Handling)

"IBM Mainframe Assembler List"  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 THEN, ELSE, and ENDF.  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
-- 
int.ext: 91078
direct: (937) 531-6378
home: (937) 751-3300

Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio  45439  USA
(937) 294-5331






*
This email message and any attachments is for use only by the named 
addressee(s) and may contain confidential, privileged and/or proprietary 
information. If you have received this message in error, please 
immediately notify the sender and delete and destroy the message and all 
copies. All unauthorized direct or indirect use or disclosure of this 
message is strictly prohibited. No right to confidentiality or privilege 
is waived or lost by any error in transmission. 

*