Oppolzer - Informatik / Blog


Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie

ASSEMBLER-L - Umbau zentraler Makros auf relative Sprünge (baseless)

Subject:

Relative Branches / IBM macros

From:

Bernd Oppolzer <bernd.oppolzer@T-ONLINE.DE>

Reply-To:

IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>

Date:

2013.04.05 21:39:44


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 flavour 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

Blog-Hauptseite      Neuester Artikel      Älterer Artikel      Neuerer Artikel      Älterer gleiche Kategorie      Neuerer gleiche Kategorie