Bernd, First and foremost be sure to use SYSSTATE ARCHLVL=2 at the start of all code. This relieves many such issues, though not all.
When I have attacked the CALL problem before, I usually converted "normal" "CALL ..." to "CALL ...,MF=E", allocating the MF=L area in some dynamic area available to the routine at the point of the call, and initialize the MF=L area myself. IOW, do not let CALL allocate or set any area itself. In extremis you could make your own "MYCALL" macro to do these things for you, and OPSYN CALL to MYCALL I also sometimes use LINKINST operand of CALL to change BALR to BASR, though I haven't checked lately if ARCHLVL=2 cures that without using LINKINST. I also always change GETMAIN to STORAGE OBTAIN, which does respect ARCHLVL=2. HTH Peter -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Bernd Oppolzer Sent: Friday, April 05, 2013 3:40 PM To: [email protected] Subject: Relative Branches / IBM macros Hello all, since some weeks now, I am in charge to support our inhouse ASSEMBLER macros which support our remaining ASSEMBLER developers. These are a special flavor of structured programming macros and other macros to do everyday standard work. It's because the only fellow worker who did this before me has just retired and he handed this task over to me. We also have two macros to support the construction of subroutines inside of large programs. They establish a base register (or two), save some registers and restore them on return, but they don't do save area chaining. Because the USING point is at the start of the subroutine and the literals are at the end (using LTORG), and the number of base registers is limited to two, the size of every individual subroutine is limited to 8k. Now I thought about getting rid of this limit by moving the USING point to the end of the subroutine and move all the code in between to baseless coding. This should be possible, because the SP macros already generate J instructions. When I did this, I realized that some of our other macros generated inline definitions and LA instructions, for example - that is, they didn't work without a base register. I corrected that by using BAS etc., or in some cases, by establishing temporary base registers, using R15, for example. For some old programs and embedded IBM macros like LOAD, I used IEABRCX DEFINE, which could be included by a keyword parameter on the central overall start macro (RELB=YES). Now (almost) everything works fine; I can write very large subroutines. I already migrated some very large programs, and it worked without problems; the programs had always addressibility issues in the past, and now it's all fine. And: the programs do the same things as before :-) But there are some annoying exceptions: - normal IBM CALL generates inline definitions and LA instructions - IBM GETMAIN RC,LV=(R1) generates inline definitions and LA etc. How can I fix this? I have the old macros still at hand; fortunately I gave new names to the new macros, so I can mix old and new ones. I can also establish a temporary base register around the GETMAIN, for example, but that's not very nice. Are there any parameter which I'm possibly not aware of, or: should I get rid of those GETMAIN calls in favor of more modern calls, like STORAGE OBTAIN? What is the right way to go? Sorry, if this is too obvious for you ... I've had not much time in the last years to deal with those ASSEMBLER topics and had no time to really take over the task from my former co-worker, so I feel a little bit like a beginner. But it's much fun :-) Kind regards Bernd -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
