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