On Thu, 9 Sep 2010 07:02:42 +0200, Fred van der Windt wrote:

>>          LH    R1,=H'-4096'
>>          USING -4096,R1
>>          LA    R2,*
>>          LA    R3,-4(,R2)
>>
>> What does R3 now address?
>>
>> This caused a great deal of debate on this list several years
>> ago.  Very few contributors got it right.
>
>I would assume that the last LA would just add 0000FFFC
>to the contents of R2. But the contents of R2 seem undefined;

Undefined?  Hardly.  Register 2 was loaded with the address of
the LA instruction because of the base register that is required,
as you point out, for the access of the literal.

>we need more information. I cheated and tried to assemble your
code. It needs a base register to address the literal.

Of course it does.

>It then uses that same register to assemble "LA    R2,*" and
>all the R1 stuff isn't used anymore. If I change the code to...
>
>          LHI   R1,-4096
>          USING -4096,R1
>          LA    R2,*
>          LA    R3,-4(,R2)
>
>...to get rid off the base register requirement it doesn't
>assemble anymore:

you also need to change the LA R2,* to LARL R2,*

--
Tom Marchant

Reply via email to