What is the appropriate MIPS code equivalent to given c-style co int doAdd (int t0, int tl) { return t0+tl*2; } a) sll $al,$al,l add $v0,$a0,$al jr $ra doAdd: b) mul $r1,$rl,2 add $v0,$r0,$rl jr $ra doAdd: c) sll $t1,$t1,1 add $v0,$t0,$t1 jr $ra doAdd: d) doAdd: mul $s1,$sl,2 add $v0,$s0,$s1 jr $ra

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 17RQ: When you perform arithmetic operations with operands of different types, such as adding an int and a...
icon
Related questions
Question
What is the appropriate MIPS code equivalent to given c-style code?
int doAdd (int t0, int t1)
{
return t0+tl*2;
}
a)
sll $al,$al,l
add $v0,$a0,$al
jr $ra
doAdd:
b)
mul $rl,$r1,2
add $v0,$r0,$rl
jr $ra
doAdd:
c)
sll $t1,$t1,1
add $v0,$t0,$t1
jr $ra
doAdd:
d)
doAdd: mul $s1,$sl,2
add $v0,$s0,$s1
jr $ra
Transcribed Image Text:What is the appropriate MIPS code equivalent to given c-style code? int doAdd (int t0, int t1) { return t0+tl*2; } a) sll $al,$al,l add $v0,$a0,$al jr $ra doAdd: b) mul $rl,$r1,2 add $v0,$r0,$rl jr $ra doAdd: c) sll $t1,$t1,1 add $v0,$t0,$t1 jr $ra doAdd: d) doAdd: mul $s1,$sl,2 add $v0,$s0,$s1 jr $ra
What is the appropriate MIPS code equivalent to given c-style code?
int doAdd (int t0, int t1)
{
return t0+tl*2;
}
a)
sll $al,$al,l
add $v0,$a0,$al
jr $ra
doAdd:
b)
mul $rl,$r1,2
add $v0,$r0,$rl
jr $ra
doAdd:
c)
sll $t1,$t1,1
add $v0,$t0,$t1
jr $ra
doAdd:
d)
doAdd: mul $s1,$sl,2
add $v0,$s0,$s1
jr $ra
Transcribed Image Text:What is the appropriate MIPS code equivalent to given c-style code? int doAdd (int t0, int t1) { return t0+tl*2; } a) sll $al,$al,l add $v0,$a0,$al jr $ra doAdd: b) mul $rl,$r1,2 add $v0,$r0,$rl jr $ra doAdd: c) sll $t1,$t1,1 add $v0,$t0,$t1 jr $ra doAdd: d) doAdd: mul $s1,$sl,2 add $v0,$s0,$s1 jr $ra
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr