I vote for this one!

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Ngan, Robert (DXC Luxoft)
Sent: Tuesday, November 23, 2021 11:44 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Base-less macros

Or even simpler:

CLIJE R15,0,RC0ROUTINE
CLIJE R15,4,RC4ROUTINE
CLIJE R15,8,RC8ROUTINE
CLIJE R15,12,RC12ROUTINE
J     UnexpectedRC


Robert Ngan
DXC Luxoft

-----Original Message-----
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> On Behalf 
Of Pieter Wiid
Sent: Tuesday, November 23, 2021 12:29
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Base-less macros

Or
CIJE R15,0,RC0ROUTINE
...etc

-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Watkins, Doug
Sent: Tuesday, 23 November 2021 20:00
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Base-less macros

Mark,

Another vote for not using branch tables, for all the reasons already 
mentioned. This is what I do...

CHI  R15,0
JE   RC0ROUTINE
CHI  R15,4
JE   RC4ROUTINE
CHI  R15,8
JE   RC8ROUTINE
etc.

I understand you might be concerned about performance if you have dozens of 
return codes, the higher ones are returned frequently, and the routine from 
which control is being returned is called many, many times over. However, that 
is not a concern for my application.

Regards,

Doug

-----Original Message-----
From: IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU> On Behalf 
Of Mark Hammack
Sent: Tuesday, November 23, 2021 10:42 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: [EXTERNAL] Re: Base-less macros

So as a related question, I started working on a 'baseless' version of a branch 
table macro I wrote years ago.  I have it working but was curious what other 
people have done.

In 'based' code, it typically generates something like:

B   *+4(15)
B    RC0ROUTINE
B    RC4ROUTINE
B    RC8ROUTINE
etc.

The best I could come up with for 'baseless' code is:

LARL  14,*+((48+32+16)/8)
L         14,0(15,14)
BR       14
J    RC0ROUTINE
J    RC4ROUTINE
J    RC8ROUTINE

As to the specific question asked in the thread, I recently ran into an issue 
where a macro expanded by a couple of bytes which threw the literals out of the 
4k 'base'.  The way I took care of *most* of the issue was to go with 
immediate, long displacement or relative instructions as much as possible which 
all but eliminated the need for an LTORG or at least reduced the need for 
multiple LTORGs in the program.

*Mark Hammack*
Systemware, Inc.
Senior z/OS Developer
mark.hamm...@gmail.com
214-478-0955 (c)



--
This email has been checked for viruses by Avast antivirus software.
https://clicktime.symantec.com/34azrGaNF3hyxgii8E2dVoc6xU?u=https%3A%2F%2Fwww.avast.com%2Fantivirus

Reply via email to