C to MIPS compiler

This program will use the g++ compiler to turn provided C code into MIPS assembly language. Note that the assembly code produced is suitable for use on a real production MIPS machine, but will NOT work as-is in SPIM. This is for a few reasons: This operation is basically the same as doing g++ -S mycode.c on your local command line, except that will output assembly lanuage specific to your platform (e.g., Intel x86 on PC/Mac). This tool uses a cross compiler to generate MIPS assembly instead of native assembly language, and is provided because installing a MIPS cross compiler can be annoying.

Do not attempt to use this tool to "automate" homework questions involving MIPS assembly programming. Your code will not work in SPIM for the reasons above and you'll spend more time adapting it than if you'd just written it from scratch. Also, code generated by compiler has a detectable structure, which we'll check for.

C code:

C to MIPS compiler tool by Tyler Bletsch is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.

This tool was created by starting with an Ubuntu 14.04 server with Apache+PHP and installing the MIPS cross compiler per these directions. Source of this PHP script is here.