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?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education