Very interesting...

I assembled this fragment on VSE and got a slight warning about the USING
0,9 with HLASM R6.0

                 R:9  00000           3          USING 0,9
** ASMA306W USING RANGE OVERLAPS IMPLICIT USING 0,0

But the generated code is as you showed... (   LA 2,256(0)  is interpreted
the same as LA 2,256 - no surprise there)

Never thought about     USING 0,r


On Fri, 8 Nov 2019 at 16:15, Bob Raicer <[email protected]> wrote:

> Well, the statement from Peter Relson (and others) which is
> essentially:
> ----------
> LA R1,1 is exactly equivalent to LA R1,1(0).  Just look at the
> generated object code.
> ----------
> is not totally true.  It all depends upon which USINGs are in effect.
>
> Take a peek at the following example (admittedly a bit unusual, but
> perfectly legitimate).
>
>     Loc   Object Code      Addr1    Addr2    Stmt   Source Statement
> 00000000                00000000 00000008      1 EXAMPLE  CSECT ,
>                      R:9 00000000               2          USING 0,9
> 00000000 4120 9100               00000100      3          LA 2,256
> 00000004 4120 0100               00000100      4          LA 2,256(,0)
>                                                 5          END   ,
>
> If the intent is to place a truly non-relocatable value (e.g., a
> constant) into a GPR (which IS the intent of this example), then I
> believe the coding style of statement 4 is the preferred way to go; it
> is explicit and unambiguous.  This applies to many other instructions
> which use base+displacement operands (examples:  SLL, SRL, SLDL)
> which are not interpreted as address values.
>
> Bob
>

Reply via email to