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
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