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 input.txt. This file is provided in eLearning.
The file has 7 strings. Read all 7 strings into the data memory.
b. Prompts the user for one integer number by displaying string #1. Store in variable X.
c. Prompts the user for a second integer between X and 100 by displaying strings #2 and
#3. Store in variable Y.
d. Exits if X > Y or if they enter 0(zero).
e. Displays X and Y on the screen by using string 4 & 5.
1
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 #6 and before displaying the recursive procedure print
string #7.
g. Repeats from b. until the user inputs 0(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 itr_sumsq) and the other is recursive (named rec_sumsq).
For example the cumulative sum of squares from 2 to 8 is
413295490139203
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 rec_sumsq procedure at the point where the stack pointer (register
$sp) is smallest, i.e. 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 1 and 100(Type 0 to stop):
Give me a second number between
and 100(Type 0 to stop):
Adding squares from
to
ITERATIVE:
RECURSIVE:
Write a MIPS assembly language program that a .

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 Programming Questions!