Should that second instruction be an LA?

I quit using branch tables. I know, they are useful, but IMHO wild branches are 
the worst of bugs, and so I have eschewed branch tables.

The architecture could use a new instruction "branch relative indexed" or JI. 
So then your original code would become

JI   *+4(15)
J    RC0ROUTINE
J    RC4ROUTINE
J    RC8ROUTINE

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Mark Hammack
Sent: Tuesday, November 23, 2021 7:42 AM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: 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.

Reply via email to