On Mon, 26 Aug 2024 14:06:06 -0400 Tony Harminc <[email protected]> wrote:

:>On Mon, 26 Aug 2024 at 11:50, Richard Zierdt <
:>[email protected]> wrote:
:>
:>> Writing code using relative addressing, as much as reasonably possible.
:>> Problem:  some IBM macros, e.g., ATTACH(X) and STORAGE, generate L and
:>> LA(E) instructions instead of, e.g., LRL and LA(E)Y.
:>>
:>> STORAGE  OBTAIN,
:>>       Length=(0),
:>>       Loc=(31,31)
:>> generates this instruction
:>>       L      15,=AL1(B'00000000',(0*16),(0),B'01110110')
:>> requiring a base register
:>> instead of, e.g.,
:>>       LRL   15,=AL1(B'00000000',(0*16),(0),B'01110110')
:>> (Load Relative Long) which does not.

:>Is that literal is guaranteed to be on a fullword boundary. I realize that
:>literal pool items are generated on a boundary matching their size, but I'm
:>not so sure the "size" of an AL1 even with four sub operands is 4 (vs 1).
:>OK - tried it, and it does indeed generate it on a fullword boundary.

Yes, it depends on the length of the literal. If odd, byte. 2, halfword. Etc.

:>ATTACHX EP=SUBTASK
:>> generates
:>>       LAE   15,IHB0098         SET UP LIST ADDRESS
:>> instead of
:>>      LAEY  15,IHB0098         SET UP LIST ADDRESS

:>LAEY is still a base-displacement instruction, though of course with a long
:>displacement. How would it help - you still need a register. I don't think
:>there is any relative instruction that sets the matching AR. For that
:>matter, doesn't the use of LAE imply that the AR might not be that of the
:>current code? I suppose trhey could use CPYA or LAM or something followed
:>by LARL.

Don't see why a relative instruction should care about ARs.

LAEY allows addressibility before the base register and beyond 4K.

--
Binyamin Dissen <[email protected]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to