Question
I need MIPS for Qpspim program You are to write a program that does the following:The program accepts a single-letter input from the keyboard at
I need MIPS for Qpspim program
You are to write a program that does the following:The program accepts a single-letter input from the keyboard at a time. The letter input must be lower-case a through z (upper-case, except for P or non-letter characters except for number 1 result in an error message and prompt to try again). Only one letter must be input at a time. Make sure that (a) only one letter is input at a time, and (b) the character is ONLY a lower-case letter (letter P and number 1 are special cases mentioned below). The program will accept up to three lowercase letters in any one run.
In the program data declaration, you must declare a string of letters (named str) which is a sequence of all 26 lower-case letters in alphabetical order.
The program must take input of a character from the keyboard and inserts it (if it is a lower-case letter) in the proper place in the sequence of letters declared in str.
Declare a sequence of 30 null bytes using the .space directive. This will be expansion space for the string as you insert characters into the alphabetized list (up to 3 additional characters).
At any point, you can print the current string (i.e., with as many letter inserts as have been made that far) by inputting capital P from the keyboard. The program will continue to prompt for a lower-case letter.
When 3 lowercase letters are input, the program prints the new ordered string and prompts you to rerun the program. If response is y, it restarts the program. If not, it will print program terminated and stops.
The program will also stop after printing the current string and program terminated if you enter a 1 when prompted for a letter.
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