Question: Write a MIPS procedure called findx which finds the first occurrence of the letter x in an area of memory (array). The procedure receives three

Write a MIPS procedure called findx which finds the first occurrence of the letter x in an area of memory (array). The procedure receives three arguments in $a1, $a2, and$a3, where $a1is the starting memory address of a null-terminated ASCII string, $a2 has the starting index (0) and $a3 is the x character. The findx procedure will locate the first xcharacter in the string and return the position where it was found in register$v1. If there are no xes in the string, findx should return -1 in register $v1. Your program should print the index returned by findx using a syscall.

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!