pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] indexed addressing mode page 15 (revisited)


From: Justis Durkee
Subject: Re: [Pgubook-readers] indexed addressing mode page 15 (revisited)
Date: Wed, 5 Oct 2011 21:33:47 -0700

>How can this be if we are going  forward 4 bytes ( 0,1,2,3 ?) at a time we would arrive at >location 2017 ( the last byte of the 4th word) ??

You are referencing the multiplier value 4 in two places. word size (4 bytes) and 4th word, when it is really the 3rd word, since the index is 3.

The multiplier designates how big our movements are, and the index designates how many movements to make.

When index = 3 and multiplier equals 4, we move 4 bytes 3 times for a total of 12. 

On Wed, Oct 5, 2011 at 8:09 PM, Kenny Hegeland <address@hidden> wrote:
I'm wondering how you worked out 2017. As far as I know it's similar to the addition addressing. If we were just counting numbers it would look like this:

2002 + (3 * 4) =
2002 + 12 =
2014


On Oct 5, 2011, at 10:07 PM, michael osullivan <address@hidden> wrote:

This was discussed back in 2010-03

http://lists.nongnu.org/archive/html/pgubook-readers/2010-03/index.html

but as i didn't understand it fully from reading those posts, and it was over a year ago here is my own question:
--------------------------------------------------------------------------------------------------------------------------
Hi,
i have a question after reading the beginning of the book. On page 15 we read that :
"In the indexed addressing mode, the instruction contains a memory address to
access, and also specifies an index register to offset that address."

Now this is all easy to follow:  a memory  address offset by the number contained in an index register.  So with the starting address being 2002, with an offset of 3 we arrive at the memory location 2005.

Then we have the next concept: the multiplier for the index, allowing us to access memory one byte at a time , as above, or a word/4 bytes at a time with a value of 4.

So starting at 2002 and loading index register with 3 ( zero would mean the location we specified in the first place ? ) ,  specifying a multiplier of 1 (one byte at a time ) cycling through the the next 3 bytes we come to 2005.

Now the next example we start at 2002 again but want to cycle 4 words forward so we have

2002  index 3  + multiplier 4 (one word)  arriving at memory location 2014

How can this be if we are going  forward 4 bytes ( 0,1,2,3 ?) at a time we would arrive at location 2017 ( the last byte of the 4th word) ??


Any help greatly apreciated

Mike
_______________________________________________
Pgubook-readers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/pgubook-readers

_______________________________________________
Pgubook-readers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/pgubook-readers



reply via email to

[Prev in Thread] Current Thread [Next in Thread]