How about fixing the problem you had with branch tables and introducing
a new instruction JIC (branch relative indexed conditional)?

JIC *+4(15),nn
J     RC0ROUTINE
J     RC4ROUTINE
J     RC8ROUTINE
J     RCERR_RTN

Where nn is an immediate value hw that limits the value of RC and Jumps
to *+4+(nn+4) if it is exceeded (last valid entry + 4)

On 2021-11-23 11:24 a.m., Charles Mills wrote:
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



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.


-----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