Download the skeleton program simplearithmetic2.asm from our course Canvas site (look in the Modules section) and take a look at it. You are supposed to implement the arithmetic function: 2*a+b-16*c-60, where: a = -5, b=12, c = 5. You have to ensure that variables a, b, c, MUST be stored in registers $t0,$t1,$t2, respectively, and that the result MUST be stored in register $t3. In addition, the multiplication factors MUST ONLY be implemented by using bit-shift left. You can use either addi or li to assign value to registers. a) Write down (or type) the missing code here after you've verified it by running it on spim. b) Write down (or type) exactly what you see printed out on your display after you run this. Is it what you expected? Why? c). In hexadecimal format, what is the value stored in register $t3 at the conclusion of this program? Explain how you got to thi. answer.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 12E: (Program) Write a program that tests the effectiveness of the rand() library function. Start by...
icon
Related questions
Topic Video
Question
Download the skeleton program simplearithmetic2.asm from our course
Canvas site (look in the Modules section) and take a look at it.
You are supposed to implement the arithmetic function:
2*a+b-16*c-60, where: a = -5, b=12, c = 5.
You have to ensure that variables a, b, c, MUST be stored in registers $t0,$t1,$t2,
respectively, and that the result MUST be stored in register $t3.
In addition, the multiplication factors MUST ONLY be implemented by using bit-shift left.
You can use either addi or li to assign value to registers.
a) Write down (or type) the missing code here after you've verified it by running it
on spim.
b) Write down (or type) exactly what you see printed out on your display after you
run this. Is it what you expected? Why?
c)
In hexadecimal format, what is the value stored in register $t3 at the conclusion
of this program? Explain how you got to thi. answer.
Transcribed Image Text:Download the skeleton program simplearithmetic2.asm from our course Canvas site (look in the Modules section) and take a look at it. You are supposed to implement the arithmetic function: 2*a+b-16*c-60, where: a = -5, b=12, c = 5. You have to ensure that variables a, b, c, MUST be stored in registers $t0,$t1,$t2, respectively, and that the result MUST be stored in register $t3. In addition, the multiplication factors MUST ONLY be implemented by using bit-shift left. You can use either addi or li to assign value to registers. a) Write down (or type) the missing code here after you've verified it by running it on spim. b) Write down (or type) exactly what you see printed out on your display after you run this. Is it what you expected? Why? c) In hexadecimal format, what is the value stored in register $t3 at the conclusion of this program? Explain how you got to thi. answer.
1
HNm tin có
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
.text
main:
# TODO: implement the arithmetic function: 2*a + b 16*c 60, where a = -5, b = 12, c = 5.
Variables a, b, c, MUST be stored in registers $t0, $t1, $t2, respectively.
The result MUST be stored in register $t3.
ADDITIONALLY: The multiplication factors MUST ONLY be implemented by using bit-shift left.
# # # =
#
ASM simplearithmetic2.asm
# DO NOT MODIFY THE FOLLOWING INSTRUCTIONS!
# Print to std.output
li $v0, 1
move $a0, $t3
syscall
# End program
li $v0, 10
syscall
Transcribed Image Text:1 HNm tin có 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 .text main: # TODO: implement the arithmetic function: 2*a + b 16*c 60, where a = -5, b = 12, c = 5. Variables a, b, c, MUST be stored in registers $t0, $t1, $t2, respectively. The result MUST be stored in register $t3. ADDITIONALLY: The multiplication factors MUST ONLY be implemented by using bit-shift left. # # # = # ASM simplearithmetic2.asm # DO NOT MODIFY THE FOLLOWING INSTRUCTIONS! # Print to std.output li $v0, 1 move $a0, $t3 syscall # End program li $v0, 10 syscall
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Instruction Format
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr