Tony Harminc commented: > On 17 December 2010 15:22, Bodoh John Robert <[email protected]> wrote:
> > When a macro receives an ordinary symbol as a parameter it may need to > > reference the symbol (get the address of the storage location > > represented by the symbol). If the symbol is within the current CSECT > > and the program is using baseless coding, a relative addressing op code > > must be used to get the address of the storage referenced by the symbol. > > Otherwise, a base/displacement op code must be used. > If your macro really has to know, then I think you'll have to > implement a bit of macro infrastructure that allows you to set the > mode to be used, perhaps in your entry macro, and of course stores it > in a suitable GBLB or the like. There is no formal way in which you > tell the assembler that your program operates in based or baseless > mode, though inferences can be drawn. One could stretch this rather a > long way, but it's getting into the realm of idle speculation... For > instance the assembler could somehow let you know if there is an > active USING that covers any part of CSECT space, and you could base > your decision on that. But that's full of holes, I'm sure. Unfortunately, there's no general way HLASM can know which base registers cover which parts of the program until after the end of the first pass -- which is when macro expansion occurs. If it's really important to you, your best bet is to write your own "MyUSING" and MyDROP" macros that capture useful information and then issue the normal USING and DROP instructions.
