On 15 December 2014 at 16:15, John McKown <[email protected]> wrote:
> I was thinking that, so it means if I do something like:
>
> LARL R2,SOME_LABEL
>
> while in AR mode, I need to follow that up with another instruction to set
> the AR2 to primary mode unless I am certain that AR2 has not been "messed
> with". E.g. do:
>
> LARL R2,SOME_LABEL
> LAE R2,0(R2,0)    SET AR2 TO ZERO

Or LAM or SAR, which might make things clearer. I'm not sure that
using that comma placement this way is wise. Yes, we should all
understand the difference, but as you read someone else's code, will
you always?

> I guess that I really want LARLE to set AR2 as well a GPR2.

But what would you expect it to set AR2 to? Zero? In which case it
should perhaps be called LARLZ or LARLZA or LARLEZ or something.
LAE[Y] has an implicit source AR that it (in appropriate cases) copies
to the implicit target AR. The source address in LARL is resolved
without reference to any register, so unless you want it to use the
implicit target AR number as a source also (yuck), or always behave
like LAE[Y] in non-AR mode...

Overall I think LAEY is your best bet, unless you must run on fairly
old hardware. You have a large signed address range, but of course you
do need a "base" register to start with.

Tony H.

Reply via email to