CS641 Getting started with MIPS Assembly Language Setup: To run mips-gcc: add /usr/local/bin/mips to the PATH defined in your .profile. For example, mine now says: PATH=:/usr/local/bin:/usr/local/bin/mips:/usr/ucb:/bin:/usr/bin:$HOME/bin:. ^^^^^^^^^^^^^^^^^^^ added to old PATH While you're editing .profile, also add this line: cs641=/courses/cs641/public_html;export cs641 This allows us to access the class web page directory as $cs641. To turn in: 1. Write an assembler program that counts the number of a's in the string "aabcabcabc", itself set up in the data area like "Hello, world!" is in hello.s. Output the final count using print_int. Put the assembly code in counta.s. The code should still work if the particular string is changed, of course. Save the SPIM log in counta.log. For a final run, bring up SPIM, set a breakpoint where the count is incremented (in a register of course), and run the program, continuing each time an increment is made. After the program finishes, save the log: it will show the output and the breakpointed instructions. 2. Problem 2.18.2a. Put the code in loop1.s. Use a=0 and b=2. Run it and make sure a ends up at 20. Save the final state in loop1.log: it should show 20 in the register you used for a (let's make it $s0). 3. Problem 2.18.b has C code with an array. Put this in array1.c, inside main, starting with a=0, b=2. Compile it to array1.s with mips-gcc, and examine the assembly language that is generated. Convert it to array2.s that SPIM can handle, and is as simple as possible. Run array2.s with SPIM. Make sure the D array ends up with the expected contents. Simplification for #3: You can skip the mips-gcc part and just write array2.s directly. We haven't yet covered using mips-gcc.