a. Suppose the user enters a = 5, b = 10, and c = -30, what is the expected value of s? => b. Which instruction in your program computed the value of s and which register is used?

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 8PP: (Statistical) In many statistical analysis programs, data values considerably outside the range of...
icon
Related questions
icon
Concept explainers
Question
The below program is:

A MIPS program that executes the statement: s = (a + b) – (c + 101), where a, b, and c are user provided integer inputs, and s is computed and printed as an output.

.data
   askA: .asciiz "Enter value of a: "
   askB: .asciiz "Enter value of b: "
   askC: .asciiz "Enter value of c: "
   msgS: .asciiz "Result s: "
.text
   # Prompt user to enter value of a
   li $v0, 4
   la $a0, askA
   syscall
   # Get user input
   li $v0, 5
   syscall
   #store the result in t0
   move $t0, $v0
  
   # Prompt user to enter value of b
   li $v0, 4
   la $a0, askB
   syscall
   # Get user input
   li $v0, 5
   syscall
   #store the result in t1
   move $t1, $v0
  
   add $t2, $t0, $t1
  
   # Prompt user to enter value of c
   li $v0, 4
   la $a0, askC
   syscall
   # Get user input
   li $v0, 5
   syscall
   #store the result in t0
   move $t0, $v0
  
   add $t1,$t0,101
  
   sub $t0,$t2,$t1
  
   li $v0, 4
   la $a0, msgS
   syscall
   #print or show the age
   li $v0, 1
   move $a0, $t0
   syscall

My question is, I want to know the answers to these questions:

=> a. Suppose the user enters a = 5, b = 10, and c = -30, what is the expected value of s?
=> b. Which instruction in your program computed the value of s and which register is used?
=> c. What is the address of this instruction in memory?
=> d. Put a breakpoint at this instruction and write the value of the register used for computing s in decimal and hexadecimal.


Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Operators
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