Write a MIPS procedure that takes as its three parameters the address of a zero-terminated string, a character c, and an integer n, and 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. Your code must use the “standard” conventions covered in class for passing parameters and returning results.    code in mips

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section4.2: The If-else Statement
Problem 3E
icon
Related questions
Question

Write a MIPS procedure that takes as its three parameters the address of a
zero-terminated string, a character c, and an integer n, and 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. Your code must use the “standard” conventions covered in class for passing
parameters and returning results. 

 

code in mips

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Huffman coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr