Compiling a arithmetic code in C Using Registers

Problem: The compiler has a bug inside and it is not working. You have to its job to associate program variables with registers:

Solution:
f = (g + h) - (i + j)
add $t0, $s1, $s2 #gets g + h
add $t1 ,$s3, $s4 #gets i + j
sub $s0, $t0 , $t1 # gets (g + h) - (i +j)


4 comments :

Follow Me

If you like our content, feel free to follow me to stay updated.

Subscribe

Enter your email address:

We hate spam as much as you do.

Upload Material

Got an exam, project, tutorial video, exercise, solutions, unsolved problem, question, solution manual? We are open to any coding material. Why not upload?

Upload

Copyright © 2012 - 2014 Java Problems  --  About  --  Attribution  --  Privacy Policy  --  Terms of Use  --  Contact