Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve this please related to assembly language. Its in MIPS Assembly Language. Question requires use of stack pointers. please follow the conditions. Add comments for

image text in transcribed

image text in transcribed

Solve this please related to assembly language. Its in MIPS Assembly Language. Question requires use of stack pointers. please follow the conditions. Add comments for easy understanding.

Registers can be used( only the one mentioned) Use stack pointers too!!

Task-2 [35 Marks] 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. . . ########################## #Name: #Roll Number: #Name of program: al-t2.asm #Course Code: #Section: ##### #### .data #your data segment goes here .text main: #we need to add five integers #first create appropriate space on stack #ask user to enter first number jal displayPrompt #get first number jal getNumber #ask user to enter second number jal displayPrompt COMP 300 Section B Fall 2021 #get second number jal getNumber #ask user to enter third number jal displayPrompt #get third number getNumber jal #ask user to enter fourth number jal displayPrompt #get fourth number jal getNumber #ask user to enter fifth number jal displayPrompt COMP 300 Section B Fall 2021 #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 process Numbers 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: COMP 300 Section B Fall 2021 displayResult: 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Bachelors degree in Information Systems or Statistics

Answered: 1 week ago