LH is an RX instruction.

So, LH 3,=H'-5' would give an addressing exception, no? Because the second
operand is treated as coming from storage? So that would be a negative
address?

If you said LH 3,0(=H'-5',2), that would give you ITEM+5?

Joe



On Sat, Oct 23, 2021 at 6:01 PM Bernd Oppolzer <[email protected]>
wrote:

> So this means that
>
> LA   2,ITEM+10
> LH   3,=H'-5'
> LA   2,0(2,3)
>
> will put the address ITEM+5 in register 2, at least in AMODE 24/31?
>
> With AMODE 64, this will be a problem, because the LH instruction only
> fills the right half
> of the 64 bit register 3, right?
>
> Is there a way to do this right in all AMODEs?
> For positive indexes? (only, if we assume the left half to be zero?)
>
> Thanks, kind regards
>
> Bernd
>
>
> Am 23.10.2021 um 23:48 schrieb Steve Smith:
> > I'm pretty sure that given the context, the question is about AMODE 64 on
> > z/Architecture.
> >
> > To the original question: the sign is never "ignored".  But there is no
> > sign on base or index addresses.  They are treated as unsigned numbers
> with
> > the length of addresses of the current AMODE.  When added up, along with
> > displacement, any overflow is ignored, effectively making the result
> > modulo-2**AMODE (I'm pretty sure that B. Dissen meant modulo 2**64).
> >
> > So, what you call -1 is actually 18,446,744,073,709,551,615, but because
> of
> > overflow/wrap-around, it works like -1.
> >
> > For instructions with signed displacements, the displacement is
> > sign-extended as needed; otherwise it's the same.
> >
> > sas
> >
> >
>
> ----------------------------------------------------------------------
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to [email protected] with the message: INFO IBM-MAIN
>

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

Reply via email to