Question
Write a MIPS assembly language program with the following functions: -A function that calculates the length of a string. The string should be stored in
Write a MIPS assembly language program with the following functions:
-A function that calculates the length of a string. The string should be stored in main memory. The starting address of the string should be stored in a register.
-A function to compare two strings for equality. The function should store the value 1 in a register if the strings are equal and a 0 otherwise. Two strings are equal if the lengths are equal and the characters in every position of the string are equal. Note that A is not equal to a. The starting addresses of the strings should be stored in registers.
-A function to append one string to another string. This function must allocate main memory for the resulting string. Use the length function to calculate the exact amount of memory that must be allocated. The function should store the starting address of the resulting string in a register. Add room for a space to be appended to string1 before appending string2.
Your main program should do the following:
-Prompt the user to enter two strings and read the strings.
-Compute and output the length of each string.
-Test the two strings for equality and output the result.
-Append string2 to the end of string1 and print the resulting string.
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