Question
Use MARS to write and simulate a MIPS assembly language program to implement the strLen function. Write the main function to call strLen. The main
Use MARS to write and simulate a MIPS assembly language program to implement the strLen function. Write the main function to call strLen.
The main function should: Pass a string to strLen using registers $a0.
Preserve (i.e. push onto the stack) any T registers that the main function uses. The strLen function should:
Preserve any S registers it uses.
Determine the length of the string.
Return the length of the string to main using register $v0.
Note: A string is passed to a function by passing the starting address of the string.
Note: A C-style string is a null-terminated character array
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