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:
sw $t1, counter($a3)
The assignment is to convert this snippet of C code to MIPS
for(i = 0; i < a; i++) {
for(j = 0; j < b; j++) {
C[2 * i] = i – j; } }
All the registers change values the way they should in my program except for $a3 - It never changes.
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
EDIT: Here's the finished, working code

sw $t1, x($a3)with x=8, the value of t1 will be stored at $a3[2] (3rd int of your array, pointed by $a3). If it is not the case, then the line is never executed.myarray: .space 40for 10 words. Then you have to load the address into $a3, withla $a3, myarray, if I'm not mistaken.i-1later. Anyway, your loops are still wrong. Try to translate thewhile, that's really straightforward. Just translate what thewhiledo step by step. The only not direct point is that the condition is a "continue" condition, when you need an "exit" condition (but that's just the opposite). And translate one loop at a time, it doesn't even matter if you have duplicate labels.