From: "Paul Gilmartin" <[email protected]>
Sent: Thursday, 9 September 2010 4:32 PM

I would firmly oppose such a gentle correction.  Take a broad view.
Which has the more obvious meaning:

         LA    R3,-4(R2)       Set R3 to 4 less than R2

It doesn't.
It sums 4092 and the content of R2.
If the content of R2 is positive, the sum is larger than the original content
of R2 by 4092.*
If the content of R2 is negative, its value is increased by 4096.
However, if the intermediate sum were negative, the value being
deposited in R3 [being truncated to 24 bits) would become a large positive 
value.
In all cases, R3 becomes larger than R2.
[I'm assuming that you meant to write LA R3,-4(0,R2) ]

[* The resultant sum must not exceed 24 bits, of course in classic
base-displacement addressing.]

or:

         LA    R3,4092(R1,R2)  Set R3 to 4 less than R2

It doesn't either [viz, set R3 to 4 less than R2].
It sums the contents of Reg 1 and Reg 2 and the displacement value 4092.

?  The first hardly needs the comment to show the programmer's
intention,

What the first comment does is to show the reader that the programmer
made a programming error.

It's the same for the second LA, where the programmer has made two
erroneous assertions.

Reply via email to