Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions

Question

1. What are the major sources of stress in your life?

Answered: 1 week ago