Write a MIPS assembly language program that uses busy-waiting and memory-mapped I/O to translate a line of text, as it is being typed by the user, into a form of Pig Latin (http://en.wikipedia.org/wiki/Pig_Latin). You can assume that the typed text includes only words consisting of lower case letters, separated by spaces. Every character typed should be output as the user types it, except that words that start with a vowel (“a”, “e”, “i”, “o”, “u”) should have “way” appended to the end of the word, and words that start with any other letter should have their first letter as well as subsequent letters up to but not including the first vowel or “y” (you may assume there is at most three such letters) moved to the end of the word and “ay” appended. Note that you will only be able to recognize that a word has ended when a following space has been typed, or a newline. For example, if the user types “this is very strange” followed by the newline character, your program should output, as the user is typing, “isthay isway eryvay angestray”. Your program should terminate when the typed character is a newline (ascii code 10). (Note: in QtSpim, make sure “Enable Mapped IO” is selected under “Simulator/Settings”.)
Write a MIPS assembly language
memory-mapped I/O to translate a line of text, as it is being typed by the user, into a
form of Pig Latin (http://en.wikipedia.org/wiki/Pig_Latin). You can assume that the
typed text includes only words consisting of lower case letters, separated by spaces.
Every character typed should be output as the user types it, except that words that
start with a vowel (“a”, “e”, “i”, “o”, “u”) should have “way” appended to the end of
the word, and words that start with any other letter should have their first letter as well
as subsequent letters up to but not including the first vowel or “y” (you may assume
there is at most three such letters) moved to the end of the word and “ay” appended.
Note that you will only be able to recognize that a word has ended when a following
space has been typed, or a newline. For example, if the user types “this is very
strange” followed by the newline character, your program should output, as the user is
typing, “isthay isway eryvay angestray”. Your program should terminate when the
typed character is a newline (ascii code 10). (Note: in QtSpim, make sure “Enable
Mapped IO” is selected under “Simulator/Settings”.)
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images