Please be clear and put some comments! Thanks! 3.2 Part A: Word Count You are ta
ID: 3559037 • Letter: P
Question
Please be clear and put some comments! Thanks!
3.2 Part A: Word Count You are tasked to prompt the user to enter a string. The string consists of one or more English words separated by a space without punctuation. Your program should count the number of words, and display this count to the console. More formally, write MIPS assembly code in MARS to prompt and allow the user to enter a line of text. The text entered will be a string of English words without punctuation, except for spaces between any adjacent English words, along with a single period as the final character of the string. Count the number of English words, and finally output this number in decimal on the console display.Explanation / Answer
Starting from -1 for $2 is a trick to copy but not count the last word (of value 0). One word occupies 4 bytes.