Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need MIPS assmebly code for following. (have some 4-5 hours left) 3.2 Part A: Wo

ID: 3559045 • Letter: N

Question

Need MIPS assmebly code for following. (have some 4-5 hours left)

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. 3.3 Part B: Reading Level 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 determine the Reading Level of the string based on the number of letters in the longest word, according to the scale listed in Table 1. More formally, write a 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 letters in each English word to identify the longest such word in the string. Calculate the Reading Level according to Table 1 below and output this result on the console display. Table I: Reading Level mapping. Length of longest word Reading Level ==5 letters and 10 letters College level

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.

We see that t7 is used to store 1, which is the index of the second element. In SPIM, the second element would not be referenced by an offset of one from the address of the beginning of the array, but instead by an offset of four bytes.

Moving on.

I set have the idea that theArray[t0] would get theArray[t0-1] + theArray[t0-2]. I set t0 to 2 so that it starts at the THIRD ELEMENT of theArray. To accomplish the same effect with MIPS, I must start at an offset of 8.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote