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)