Question: Write, and test using QEMU, a RISC - V assembly procedure that takes as its two parameters the starting address of a ( zero -

Write, and test using QEMU, a RISC-V assembly procedure that takes as its two parameters the starting address of a (zero-terminated) string, and a character c, and returns the number of occurrences of the character c in the string.
Write a main program to test your procedure. Your main program should input a string from the user (you can assume that the string will be at most 40 characters, not including the zero byte delimiter), and then prompt for input of a character c. If the character c that the user inputs is the newline character (ascii code 10), your program should terminate. Otherwise, your program should invoke your procedure, output the number of occurrences of the given character c, and then prompt for input of another character c, continuing in this manner until the input character is the newline character. Your code must use the standard conventions covered in class for passing parameters and returning results.

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!