Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899

Students also viewed these Databases questions