title: Using Nested For Loops and an Array in MIPS
body: <p>This is a homework assignment, I've written the whole program myself, run through it in the debugger, and everything plays out the way I mean it to EXCEPT for this line:</p>
  
  <p><code>sw $t1, counter($a3)</code></p>
  
  <p>The assignment is to convert this snippet of C code to MIPS</p>
  
  <pre><code>    for(i = 0; i &lt; a; i++) {
         for(j = 0; j &lt; b; j++) {
            C[2 * i] = i – j; } }
  </code></pre>
  
  <p>All the registers change values the way they should in my program except for $a3 - It never changes.</p>
  
  <p>Changes: An array needed to be declared and "pointed to" by a register and a label can't be used for an offset in the manner I started with</p>
  
  <p>EDIT: Here's the finished, working code</p>
  
  <p><img src="https://i.stack.imgur.com/pEmYz.png" alt="Finished"></p>