Answered step by step
Verified Expert Solution
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 the address of a readonly const char null
terminated string s and the address of a readonly const char nullterminated
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 RISCV 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 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started