Question: Write the following in MIPS code. Read in a string str and count the number of words in it. Words are separated by spaces or
Write the following in MIPS code. Read in a string str and count the number of words in it. Words are separated by spaces or newlines. Print out the number of words followed by a blank line like this:
str = " foo bar baz ";
System.out.printf("Count = %d", count);
Do not modify the string in memory. Also are only allowed to use these specific instructions:

add, addi, sub, addu, addiu and, andi, or, ori, xor, xori, nor beq, bne, j slt, slti sll, sra, srl lw, lh, lb, sw, sh, sb la syscall add, addi, sub, addu, addiu and, andi, or, ori, xor, xori, nor beq, bne, j slt, slti sll, sra, srl lw, lh, lb, sw, sh, sb la syscall
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
