> David Eisenberg wrote:
> I want to generate baseless code using as few instructions as possible,
> Can my macro modify the resulting condition code?  

I'm horrified this was your solution especially considering all the other 
options available.

1.  Regardless of programming language or whatever you are doing, you should 
always ask yourself if you are making a choice for the right reason. Far too 
often we overthink a decision or problem only to find we are solving problems 
that will never exist. 

2. In the next 5 years, how many programs will need that extra register and you 
are willing to give up addressability to constants? For most people, it will 
only be at couple. Don't disable a useful HLAsm feature because someone 
convinced you that baseless is important. Your only job at this time is to make 
that extra register a simple choice if if's more important than constants. 
Needlessly removing the base reg is a terrible idea but preparation is 
important. The truth is that constant addressability is more important than as 
an 11th register. Truly baseless is often not the answer. For me, baseless was 
not a solution when I added entries to a large TSO parser table that caused 
addressability problems. Each addressability problem is unique and, in this 
situation, moving the table after all constants (including LTORG) was the only 
acceptable solution. It's understandable you want to solve a problem but 
consider the cost/risk/benefit of going beyond preparation.

3. Forget about converting B to J by hand because you can't modify IBM macros. 
The correct and very simple solution is to internally translate B to J. OPSYN B 
instructions to a macro. The macro only coverts B to J when it doesn't involve 
a register (no parenthesis). There are a couple of extremely unlikely 
exceptions but it's doubtful anyone will experience these exceptions.

4. Inform everyone of how to use their new choices. If they need a second base 
reg, simply change the using to the start of the constants because executable 
code does not need addressability since you B is now J (with a couple of IBM 
macro exceptions). If they absolutely need the extra register, then they need 
to decide how to best handle constants. 

5. If you insist on conversion instead of prepping for baseless code, then 
instead of CLHHSI, use LARL R1,=X'1111' before the CLC.  No sense in making 
this complicated.

6. Depending on CC outside the macro should be avoided if possible.

7. I suggest you look at using the structured macros available in the IBM HLASM 
Took Kit. Your CLHHSI problem is about esthetics. You may find coding IF 
(CLHHSI,AA,LE,X'1111') more palatable.

Reply via email to