I am just starting to understand MIPS, and the particular instruction "lw" confuses me.
From the thread, Understanding how `lw` and `sw` actually work in a MIPS program, this is what I have gathered:
If, say, we have:
lw a, 4(b) // a and b are registers
Then, it just means that we will get the data (or usually referred to a "word", which I still don't get why...) at the memory address of b
incremented by 4. Then, store it in a
.Simply in other words, getting the next data stored at the address right after the address of b
since each "word" is 4 bytes.
Also, does this mean that the data stored in b
should be a data structure, like an array? So that we can get the data at the memory address of b+4
?
Sorry, I know my wording is quite confusing... but am I on the right track? And would anyone please explain to me in, simple terms, what exactly a "word" is? Is it basically a data?