[prev] 5 [next]

Exercise 1: Expression Evaluation

Write a MIPS program to evaluate the expression:

(x*x + y*y) / (x+y)

where ...

  • x is implemented by register $s1
  • y is the label of a memory location

Leave the result of the expression in $a0

Start by writing a simplified C version.