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)


Re: Relative Branches / IBM macros


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




2013.04.08 21:43:11

Hello all,

thank you again for keeping up this discussions.

This reminds me that I have still some things to work on, that is: the loop
counters in the mainline of our ASSEMBLER programs.

What I've done so far:

We have a macro called ANFEND, which does the definition and initialization of
an arbitrary number of base registers, which in the past covered the code area
and the static data area of the mainline of the programs.

I changed this, while maintaining downward compatibility, to support now "code
area baseless coding", by introducing new keyword parms.


The code area is in general supposed to be located before the static data area.
So I introduced two new keyword parms:

BASE2=ADR means, that the second base reg and the following should cover the
area from ADR, that is: the static data area. The first base reg then covers the
first 4k of the code area, and the 2nd and the following cover the static data
area; the area following the first 4k of the code area is not covered by base

BASE1=ADR means, that the code area is NOT covered by any base reg; only the
static data area is covered by base regs (from base reg 1 up to base reg n).

The subroutines start with AVMANF and end with AVMEND. In the past, they were
restricted to two base regs, that is, 8k. Now, with RELB=YES (specified on
ANFEND), the second base reg coveres the area after AVMEND (for the local static
data), so the area between AVMANF and AVMEND (for the code) may grow.

There are also new macros AVPROC / AVPEND, which work almost like AVMANF /
AVMEND, but there the base regs don't cover the code area, but only the (up to)
8 k static area after AVPEND. AVPROC/AVPEND are only allowed with RELB=YES.

The loop counter fields are defined after AVMEND / AVPEND in the data area (I
don't need LOCTR to do this).

When the global symbol &AVGBTRC is set to 1, every AVMANF / AVMEND is traced on
a file called PUTLIST (at runtime).

What is still missing:

- there is a macro needed to generate the outstanding loop counter definitions
from the LOOP macros in the mainline (there is no end macro corresponding to the

- some of our (several hundred) other macros don't work in a "code area
baseless" environment, because they generate (for example) inline definitions
and LA. I will have to change them step by step. For the moment, the solutions
are twofold: move them into a AVMANF / AVMEND block which is less than 4k, or
etablish a temporary base reg around them.

Anyway: if management allows me to do so, I will change all the macros to
support this kind of coding, because the remaining developers have much less
trouble dealing with addressibility issues, and existing programs can be
extended with trace facilities etc. - which already helped me in solving some
difficult problems that existed for years !!

My conclusion is: this makes ASSEMBLER development much easier and more fun!

Kind regards


Am 08.04.2013 20:37, schrieb R.N.:
> Going one step further, define TWO data location counters, one for stuff
> that is required to be within 4K of the static base register i.e. are
> referenced by SS instructions, and another for stuff that can be referenced
> by instructions with displacements larger than 4K (i.e. via LY, STY, LLC,
> LARL etc).
> R.N.
> From:   T.M.
> Date:   2013/04/08 09:46
> Subject:        Re: Relative Branches / IBM macros
> Sent by:        IBM Mainframe Assembler List <ASSEMBLER-LIST@LISTSERV.UGA.EDU>
> On Fri, 5 Apr 2013 22:29:03 +0200, Bernd Oppolzer wrote:
>> There is also a LOOP macro in the SP macro set, which generates in some
>> cases
>> (in the NORENT case) a decimal loop counter, which is in defined inline,
>> near the
>> loop instructions.
> You might want to look at using LOCTR instructions to group data areas
> together.  My entry macro includes code similar to this:
>      J  BEGIN
>      DC  C'Program identifiers, etc'
> Later in the code, if I want to define a data area, I can include:
> (instructions)
>        DC  (whatever)
> (More instructions)
> Then at the end of the program, I code
>        LTORG
> All of the data areas are then grouped by the assembler at the beginning of
> the program, covered by a base register that points to the beginning.
> --
> T.M.

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