I would approach this problem by rewriting the C code as simply as possible. Any line that has more than one operator on it probably needs to be simplified (with a few exceptions). Get it to the point where you can rewrite every line of C as a line of MIPS. A few obvious problems that jump out are the fact that you use the << and & operators, but haven't used the corresponding instructions . Also, you're using bne, but the comment right next to it implies the opposite comparison.

If you want to go the compiler route, MIPS-SDE is a cross-compiler available for free download from the MIPS website, but if you already have VS as mentioned above - that's certainly easier. Though I'd second the recommendation not to do so if you're doing this for a class. I don't think there's anything wrong with your approach - you just need to have a better understanding of how each operation in C breaks down into the operations done in Assembly.