Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In a design document, outline the design and implementation strategy for an assembly proce - dure called strpbrk , identical in functionality and behaviour as

In a design document, outline the design and implementation strategy for an assembly proce-
dure called strpbrk, identical in functionality and behaviour as the standard C library string
function strpbrk. You can use man strpbrk to find the full documentation of the C func-
tion and its behaviour. Your task is to implement an assembly version of this function. The
function takes as its two parameters (1) the address of a read-only (const char *), null-
terminated string s, and (2) the address of a read-only (const char *), null-terminated
string accept . The function locates the first occurrence in the string s of any of the char-
acters in the string accept. The function returns a pointer to the first occurrence of such
character, or a NULL pointer if none are found.
Write, and test using QEMU, the RISC-V assembly procedure strpbrk. 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 a message indicating whether an occurrence has
been found, and finally terminate. Your code must use the standard conventions
covered in class for passing parameters, returning results, and using the stack.

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_2

Step: 3

blur-text-image_3

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

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions

Question

How much overlap should be provided between APs? Why?

Answered: 1 week ago

Question

Define the goals of persuasive speaking

Answered: 1 week ago