Wednesday, October 22, 2008

CONSOLE DEVELOPMENT WEEK 3

This week we started looking at MIPS (Microprocessor without Interlocked Pipeline Stages) this is the assembly language used within the PS2 and PSP. Using the tutorials available here http://chortle.ccsu.edu/AssemblyTutorial/index.html#part4 looking more specifically at chapter 13 and 15
This is Exercise 4 of chapter 13 which evaluates the equation 3x-5y using an x value of 6 and a y value of 2.

.text
.globl main
main: ori $8, $0, 6 #x value
ori $9, $0, 2 #y value
addu $10, $8, $0 #copy x value to register 10
addu $8, $10, $8 #addition method of 3x
addu $8, $10, $8 ori $10, $0, 0 #clear register 10
addu $10, $9, $0 #copy y value to register 10
addu $9, $10, $9 #addition method of 5y
addu $9, $10, $9
addu $9, $10, $9
addu $9, $10, $9
subu $10, $8, $9 #subtract 5y(stored in $9) from 3x(stored in $8)

Chapter 15 caused afew problems as the tutorial is taught using a program called SPIM where I have been using MARS, which has a better graphical interface and some additional extras. But the memory allocation is slightly different and only in the last few minutes has been explained to me so the exercises for chapter 15 have not been completed this is a job for today..... part 2 coming later today.

No comments: