Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This instruction means you are taking the value stored in $s6 and adding 4 to it and storing that new value in $t0. The value in $s6 remains the same. $s6 is a saved temp register so any time you need to change the value in $s_ you need to save it to the stack first. You are not changeing the value in $s6 so you do not need to save it to the stack. You are saving it to a temp register that you do not have to worry about what contents you have over written. Also $s6 is actualy Regester 22 or $R22 and $t0 is $r8.... </p> <p>You are basicly increasing the array by one 32 bit word to the next instruction/data word.</p> <p>This is in response to your comment:</p> <p>By you saying A[0] = 7 by convention you are saying that the "memory address" referenced by the contents of register $s6, that equals 7. $s6 does not equal 7 but what it points to in main memory does. s6 just holds a number that we interpret or know is an address. We add 4 to $s6 because we want to add enough bytes to get to the next element of the array. One word is 32 bits is 4 bytes. By convention we want to add 4 and it will be in bytes to get to the next word. A word is generally 32 bits or 4 bytes long. After adding the 4 bytes to s6 we do not know the result because we were not told what s6 originally was but we do know that t0 now points in essence to s6[1]. I would not say your are adding another indice to the array. The array would of already been set up or you are going to possible read past the end but mips as i know it does not give you an error. It will just tell you what is in the spot in main memory referenced by the address you give it. Could be blank , valid, stail, or another part of your programs data. Would need to know more of the context of the program to know more.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload