> It is not clear to me that the first is less error prone,
> especially when the program is modified later. Either of
> these eats up another register to be used as an index.
> Unless the value of register 1 is set in close proximity to
> the LA, I would find the code to be confusing. And if it is
> set immediately before the LA, you could also code:
>
> LHI R1,-4
> LA R3,0(R1,R2)
>
> A better solution (IMO) is:
>
> LR R3,R2
> AHI R3,-4
Or in this day and age:
LAY R3,-4(,R2)
Which does what it says: load R3 with the address in R2 minus 4 bytes.
Fred!
-----------------------------------------------------------------
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.
Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-----------------------------------------------------------------