Question: Write a MIPS assembly language program that a . Reads several prompts from a file called input . txt . This file is provided in
Write a MIPS assembly language program that
a Reads several prompts from a file called inputtxt This file is provided in eLearning.
The file has strings. Read all strings into the data memory.
b Prompts the user for one integer number by displaying string # Store in variable X
c Prompts the user for a second integer between X and by displaying strings # and
# Store in variable Y
d Exits if X Y or if they enter zero
e Displays X and Y on the screen by using string &
f Displays the cumulative sum of the integers squared between X and Y twice once by
the iterative procedure and the other by the recursive procedure. Before displaying the
iterative procedure print string # and before displaying the recursive procedure print
string #
g Repeats from b until the user inputs zero
This program should make use of procedures that calculate and display the cumulative sum of
the numbers squared from the first to the second inclusive. Implement two versions of this
function, one is iterative named itrsumsq and the other is recursive named recsumsq
For example the cumulative sum of squares from to is
Include in your submission a screenshot of the output display from your program for two sets of
input numbers and then exit by inputting zero. Do not repeat the example from the HW
In a PDF for each example take a screenshot of the stack data segment when the processor is
executing the code of the recsumsq procedure at the point where the stack pointer register
$sp is smallest, ie when the stack pointer stops decreasing. Give a written explanation of the
data in the stack.
Include your ASM program in your homework submission.
this is the input.txt file:
Give me a number between and Type to stop:
Give me a second number between
and Type to stop:
Adding squares from
to
ITERATIVE:
RECURSIVE:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
