On Wed, 8 Nov 2023 at 15:03, Dave Clark <[email protected]> wrote:
[...]
> LIBR RXLIBRIO - REXX SUBROUTINE FOR LIBR CALL INTERFACE Page
> 40
> Active Usings: ARXEXTE,R9 SHVBLOCK,R10 RXLIBRIO,R11 DYNASTOR,R13
> [...]
> R:C 005C8 2512 USING IPTEXIT,R12
> ESTABLISH CODE BASE REG
> ** ASMA303W Multiple address resolutions may result from this USING and
> the USING on statement number 1748
>
Rule number 1: Don't lie to the assembler.
When you say USING somewhere,Rsomething, you are making a promise to the
assembler that you will arrange at run time to have the value in the
register that you are claiming you will. There is nothing logically wrong
with having multiple registers that can address the same storage area. But
you have to keep your promise. If you tell the assembler that both R1 and
R2 can address area x, then you have to put the right value in *both*
registers - not just one you choose - because the assembler will trust you
and generate code that may use one or the other register that it chooses.
Yes, there are clear and well documented rules for which register it will
choose, but many people have been burned by thinking they understand those
rules, and then finding that an unrelated code change years later changes
the register that gets used, and causes a run-time failure.
If you are quite certain that what you are doing is logically correct, and
you just want to avoid the warning, a good approach is to use a labeled
USING for one or both registers. Then you explicitly say in each
instruction which register you want to be used. For example:
USING AREA,R5
NEW USING AREA,R6
MVC AREA(8),=CL8'Constant'
MVC NEW.AREA(8),=CL8'Newconst'
The first MVC will use R5, and the second R6 to address AREA. (Of course in
your case you don't seem to be pointing two registers at exactly the same
address, but this still works if they overlap.)
Tony H.