Question: THIS IS AN ASSEMBLY LANGUAGE ASSIGNMENT USE MIPS LANGUAGE TO SOLVE In this task you are supposed to Get five numbers from user. Add these

THIS IS AN ASSEMBLY LANGUAGE ASSIGNMENT USE MIPS LANGUAGE TO SOLVE

In this task you are supposed to

  • Get five numbers from user.

  • Add these numbers.

  • Display the result as shown in the sample run.

    While coding, adhere to the following instructions:

  • DO NOT use $v1

  • DO not use $a1, $a2, $a3

  • You can use $v0, $a0, and $ra as per your logic.

  • Can only use $t1 -- $t5 as temporary registers. No other register should be used in your program.

  • MUST NOT use temporary registers to pass input arguments to your functions, nor should these be used to return values from the functions.

  • Use stack memory to pass and return values to and from the functions.

#get second number jal getNumber

#ask user to enter third number jal displayPrompt

#get third number jal getNumber

#ask user to enter fourth number jal displayPrompt

#get fourth number jal getNumber

#ask user to enter fifth number jal displayPrompt

#get fifth number jal getNumber #let us call processNumbers function jal processNumbers

#let us call displayResult function jal displayResult

#to avoid infinite loop, and to gracefully terminate the program li $v0,10 syscall

#subroutines displayPrompt: 
getNumber: processNumbers: 
displayResult: 

COMP 300 Section B Fall 2021

Sample Run Enter first number: 1 Enter second number: 3 Enter third number: 5 Enter fourth number: 7 Enter fifth number: 9 1 + 3 + 5 + 7 + 9 = 25

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!