Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE/EEE 230 Fall 2018 Assignment 2 Due Sept 20 11:59PM Write a MIPS assembly language program to do the following. Do not use any pseudo

CSE/EEE 230 Fall 2018

Assignment 2

Due Sept 20 11:59PM

Write a MIPS assembly language program to do the following. Do not use any pseudo or extended instructions

Print your name

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.

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.

Prompt for and read two integers.

Print the absolute value of the difference of the numbers.

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.

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 the beginning of your program with your name, class, and assignment number.

Document every instruction.

Assignment 2 submittal:

Submit your assembly language program file. Do not put it in a zip file.

If your file is correctly uploaded, then you will see an exclamation mark (!) for the grade.

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

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

Students also viewed these Databases questions

Question

a. How many different groups were represented?

Answered: 1 week ago