Question: Question 6 [ 1 4 points ] In a design document, outline the design and implementation strategy for an assembly pro - cedure called strstr

Question 6
[14 points]
In a design document, outline the design and implementation strategy for an assembly pro-
cedure called strstr that searches for a string within a string. The procedure takes as its
two parameters the addresses of two (null-terminated) strings. If a sequence of characters in
the first string matches the entire second string, the procedure returns the starting index of
that sequence. If no sequence of characters in the first string matches the second string, the
procedure returns -1. Your procedure should also handle empty strings correctly. If either
string is empty, the procedure should return -1.
Write, and test using QEMU, the RISC-V assembly procedure strstr. Also, write a main
program to test your procedure. The program should prompt the user to input two strings
(you can assume that the strings will be at most 40 characters each, not including the zero
byte delimiter), call the function, display the result of the function, and finally terminate.
Your code must use the "standard" conventions covered in class for passing
parameters, returning results, and using the stack.
 Question 6 [14 points] In a design document, outline the design

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!