MIPS Programming

Here i am again talking about MIPS, as MIPS is used in the Sony PSP which we will be programming for later in the year, our task this week was to research more about MIPS and do the exercises on Chapter 13+15 from this page – http://chortle.ccsu.edu/AssemblyTutorial/index.html#part4. I read through all chapters from 1 to 15 to get my bearings, chapters 1 through 9 were quite simple where as 9 onwards i needed to read thoroughly. After finding out lots more about MIPS, reading up on loading and storing, arithmetic, the .data area and how all of this is arranged in memory I have become very fond of MIPS. Its a challenge writing so close to the machine code, a challenge i enjoyed very much!

So after reading up on these chapters I finally did the programs / exercises at the end of Chapter 13 and 15. The first set i found reletivly simple, it is just basic arithmetic. The second chapter exercises were much more challenging and drew on everything you should have learnt from that point. Here is my full program that i wrote for the last question on Chapter 15, i believe it is correct.

Chapter 15 Exercise 4 - MIPS Programming
Chapter 15 Exercise 4 – MIPS Programming

This program was writen by me using Horner’s Method, which is a method used to reduce code and speed up the workings out when finding the results to a Polynomial. I have done it using 3 registers as that is what i thought the exercise wanted, it could also be done by loading each value into different registers and working it out that way, i think that either way is acceptable but this way leaves more registers open for other uses if needed.

Leave a comment