Showing posts with label mips. Show all posts
Showing posts with label mips. Show all posts

Convert this C code into Assembly (MIPS)

Problem: Hello there, I am an old guy who understands only low level languages and my son showed me this C code: f = (g + h) - (i + j);
Would you help convert this to assembly?

Solution:
#Remember that arithmetic operations can have at most three operands.
sum x, g, h #Puts the addition of g and h in x
sum y, i, j #Puts the addition of i and j in y
sub f, x, y #Puts the subtraction of x and y into f
Read More

Put the sum of variables b, c, d, and e into variable a in assembly (MIPS)

Problem: Create an assembly sequence (or code) that places the sum of variables b, c, d, and e into variable a.

Solution: 

add a, b, c #Puts the sum of b and c into variable a
add a, a, d #Puts the sum of a and d into a new variable a
add a, a, e #Puts the sum of a and e into a new variable a

#Now you have the sum of b, c, d and e into a.
Read More

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