Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

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

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago