title: Assembly multiple arrays memory allocation
body: <p>How to allocate memory in assembly when using multiple arrays. For instance, I have 2 arrays;</p>
  
  <pre><code>la $s0, X
  la $s1, Y
  </code></pre>
  
  <p>if to "initialize" it this way, the memory allocation is contiguous, for example</p>
  
  <pre><code>Address     +0       +4       +8       +12     .....
  22112      x[0]     y[0]     x[1]      y[1]    ...
  .
  .
  .
  </code></pre>
  
  <p>In order to "fix" that, i thought of loading the fist array address initializing <code>n</code> values and then from there initialize the other. For example</p>
  
  <pre><code>arrayAllocationX:
     la $t0, X
       fill with $zero until n-1($t0)
     la $s0, X
  
  arrayAllocationY:
     la $t1, Y
        fill with $zero until n-1($t1)
     la $s1, Y
  </code></pre>
  
  <p>This did not work, as it when stating <code>la $s0, X</code> and <code>la $s1, Y</code> it continues to store values contiguously. </p>
  
  <p>I though of other ways of doing it that might work, for example; Filling items contiguously and when reading the value for either array jump 1 memory address, so x[0] = Address 2234 -> x[1] = 2234+8. But that just does not seem as good programming practice. </p>
  
  <p>Can you advise me on which is the correct way, of doing so. Thanks!</p>
  
  <hr>
  
  <p>By the way, values are always entered, and read in sequence (first x then y)</p>