Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining data addressability in HLASM

Status
Not open for further replies.

capnmark4

Programmer
Jul 26, 2006
3
0
0
US
Hi all, what I want to do (don't know if I can) is to create a macro that is 'smart' enough to do a LA x,label/ST x,... or a DC A(label) based on whether the passed parameter is "locally addressable" or not (i.e. is it base/displacement or an absolute address). I know HLASM can tell the difference because it yells at me if I do a DC A(label) when I really need to do LA/ST.

I tried T'&label but that just returned 'C' (character) and didn't help any.

Any ideas or am I just too optimistic that IBM would include this function?

Thanks,

Mark
 
I think the problem is that 'it yells at you' at assemble time so it has an advantage over you in that respect.

I am not too sure what it is you are actually trying to achieve here other than trying to prevent assembly errors. The danger is that you prevent the assembly error and end up with a runtime abend instead.
 
What I want to accomplish is to prevent Assembly and Runtime errors. Basically, I have a macro with two 'forms'. In one form, it does a LA/ST (into a DC A(0)) because the label is only addressable through a register (DSECT). In the other form, the macro generates a DC(LABEL) because it does have addressability to the label (through the binder).

What I would like to do is to make the macro smart enough to do this for the programmer rather than having them either get an assembler error, try to guess which form is needed or, use the LA/ST form (which always works but reduces efficiency).

Mark
 
I hate to say it, but compilers are pretty good at handling this sort of thing.
 
They won't change the code for you, but they will tell you when you did it the wrong way. I could get the macro to decide and dynamically adjust the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top