Question: I need to write a MIPS procedure that takes as its three parameters: 1. the address of a zero-terminated string, 2. a character c, 3.
I need to write a MIPS procedure that takes as its three parameters:
1. the address of a zero-terminated string,
2. a character c,
3. and an integer n,
The procedure returns the number of distinct runs of consecutive instances of c in the string that are of length at least n. Also, write a simple main program to test your procedure. Your main program should input a string from the user (you may assume that the string has at most 20 characters), input the character and the integer, invoke your procedure, output the return value, and then terminate. For example, given the inputs bbabbbbagbgbb, b, and 2, the output should be 3, because there are 3 instances of at least 2 of the same characters "bb", "bbbb", "bb" all of these strings have at lease 2 "b" in them.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
