Question: Write a MIPS procedure that tests whether or not one string is a substring of a second string, as well as a main program to
Write a MIPS procedure that tests whether or not one string is a substring of a second string, as well as a main program to test it. Your procedure should take as its two parameters the starting addresses of the two (zero-terminated) strings. It should return a 1 if the first string is a substring of the second string, and a 0 if it is not. Your main program should input two strings from the user (can have a maximum length of 20 characters for each), remove the newline character from the first string, invoke your procedure, then print an appropriate message. For example, if the user inputs the strings abc and abbcd, your main program should output a message that the first string is not a substring of the second, but for the inputs abc and ababcd your main program should output a message that the first string IS a substring of the second. Your code must use the standard conventions discussed in class for passing parameters and returning results.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
