+1

I have my LOCTR's named CODE and DATA but I agree with the concept: base 
register points to the CSECT; CSECT has data and LTORG's first. Hard to get 
totally away from base registers, especially if your ARCH does not support EXR.

You don't want inline data values that you branch around. They are 
cache-killers.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] On 
Behalf Of Keith Moe
Sent: Sunday, November 7, 2021 7:40 PM
To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
Subject: Re: Base-less macros

 A trick I use is to have a single "code/constant" base at the start of the 
program. Near this I branch around the constants/literals using LOCTR to place 
all the literals with the scope of the first base:

PGMSTART CSECT
 ... init code ...
....
 J MAINLINE
 ... constants ...
MAINPGM LOCTR
MAINLINE DS 0H
 ... program ...
PGMSTART LOCTR
 LTORG ,
MAINPGM LOCTR
... other stuff ....
WORKAREA DSECT 
...

This also have the advantage that I always have one register that points to the 
program entry point which makes analyzing a dump easier.

I also hate the LOOK of the code generated by the IEABRCX macro (BRC n, label 
instead of JE/H/L/etc.), so I change all of the open code and have IEABRCX 
handle the macros I have no control of.

Keith Moe
BMC Software     On Sunday, November 7, 2021, 05:54:10 PM PST, Tony Thigpen 
<t...@vse2pdf.com> wrote:  
 
 I don't think putting a LTORG in my macro would be correct. First, I 
could pick up ltorg constants from code outside my macro. Second, I 
would need a base reg for the values generated by the LTORG.

My assumption is that if someone is using base-less programming, they 
would put all their LTORGs in an area of code/data covered by a base 
register.

Tony Thigpen

Mike Hochee wrote on 11/7/21 8:29 PM:
> I'd probably be inclined to use the inline constants approach, just to have 
> some control over generated label names. Is there something preventing you 
> from incorporating LTORGs in your macros?  If not, maybe that's another 
> option.
> 
> HTH,
> Mike
> 
> -----Original Message-----
> From: IBM Mainframe Assembler List [mailto:ASSEMBLER-LIST@LISTSERV.UGA.EDU] 
> On Behalf Of Tony Thigpen
> Sent: Sunday, November 7, 2021 7:25 PM
> To: ASSEMBLER-LIST@LISTSERV.UGA.EDU
> Subject: Base-less macros
> 
> Caution! This message was sent from outside your organization.
> 
> I finally am to the point where I no longer need to worry about specific 
> customers having hardware that does not support relative instructions, so I 
> am updating some macros I provide to be baseless.
> 
> What is the 'preferred' approach to macro generated constants? In the past, I 
> have used both inline constants that I branch around, and ltorg literals 
> (=c'x').
> 
> In the past, I have been bitten by using ltorg literals and the client did 
> not put a LTORG after my macro causing a 'no active base register'
> issue. So, I am thinking inline with a BRAS is better.
> 
> Maybe there is another approach that I missed?
> 
> Suggestions?
> 
> Tony Thigpen
> 
  

Reply via email to