>
> It is better to see indexed addressing in terms of accessing arrays.
> Say you have an array of 20 integers in memory.
> (One integer = 4 bytes)
> Now you can acces these in a loop, by using an index and the fixed
> multiplier of 4 (4 bytes is the size of one element of the array).
>
> so 1st element: index = 0 in %edi, address with "start_array (,%edi,4)"
> next element: increment %edi and use same statement
> ("start_array(,%edi,4)")
> etc.
>
> When you have an array of characters (1 byte) then your multiplier is 1.
>

This makes perfect sense to me, and is what I expected in the first place.
Now that I read it again, the book does seem consistent with it---it's just
described in a way I couldn't follow.  Specifically, what I wasn't putting
together well is that the multiplier specifies the length of an element
(whether a record an array element), and the index register specifies "how
many elements" from the address.

Anyway, got it now.  Thanks to both of you.
_______________________________________________
Pgubook-readers mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/pgubook-readers

Reply via email to