On 9/9/2010 12:14 AM, Fred van der Windt wrote:
Once my erroneous comma is removed, you can walk a lot further.
Read John Ehrman's article, as cited earlier by Michael Stack:

      http://www.kcats.org/csci/464/ho/usingtechnique.shtml
Not really. The offset will still and always allow you to walk 0-4095 bytes 
forward (from the base+index location). The original problem (and the examples 
in the link) just introduce an index register to offset the 4096 byte window 
relative to the base register. In a very obfuscated manner. I don't think 
anybody meant to say that an index register doesn't allow you to move the 
'window of addressability' anywhere you want.

The USING statement always offsets the window.  What makes
one USING and implied address reference more obfuscated
than another?


The linked article already said it: "The point of these examples is not to recommend 
a particular practice, only to show how the assembler does its work; I hope they 
helped". I would 'gently correct' developers that dream up a code sequences like 
these in our shop.

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

or:

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

?  The first hardly needs the comment to show the programmer's
intention, and the assembler's checking of addressability
window makes it less error prone.

-- gil

Reply via email to