Question
Write a MIPS assembly language program to do the following. Do not use any pseudo or extended instructions, No Functions. 1. Print your name 2.
Write a MIPS assembly language program to do the following. Do not use any pseudo or extended instructions, No Functions.
1. Print your name
2. Using a bottom testing loop, prompt the user to enter a number from 1 to 5. If the number entered is not in the range from1 to 5, print an error message. Your program should continue to prompt for and read input until a value from 1 to 5 is entered.
3. Once the number is 1 to 5, then using a top testing loop, repeat the following the number of times that you finally got in the range from 1 to 5.
a. Prompt for and read two integers.
b. Print the absolute value of the difference of the numbers.
c. If the first integer is less than or equal to the second integer, print the sum of the integers from the first integer THROUGH the second integer. Otherwise if the first integer is greater than the first integer, print an error message.
4. Print program complete and then stop
Example input and output:
Ima Student
Enter a number from 1 to 5: 0
Input is out of range
Enter a number from 1 to 5: 3 This means that next section is done 3 times.
Enter the first number: 3
Enter the second number: 3
Absolute value of the difference = 0
Sum of the values = 3
Enter the first number: 2
Enter the second number: 8
Absolute value of the difference = 6
Sum of values = 35
Enter the first number: 5
Enter the second number: -2
Absolute value of the difference = 7
Sum of values cannot be determined
Program ending Specifics: Use only the instructions covered to date. No functions, etc. Document every instruction.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started