Question: Problem: String Compare Program Write a program that compares two strings to see if they are the same. Using the . DB directive, create two

Problem: String Compare Program
Write a program that compares two strings to see if they are the same.
Using the .DB directive, create two strings, labeled String1 and String2,
both of which are appropriately terminated (see Part 1). Compare the two
strings, byte by byte, to determine whether the two strings are identical. If
the two strings are identical, end the program with the hexadecimal value
of 0x01 in register R0, otherwise have register R0 be 0x00.
Note: The two strings are not necessarily of the same length, so ensure that
your program works even if the two strings are of different lengths.
Try your program with various ASCII strings in String1 and String2 to
ensure that it works in all cases.
Program Test Vectors:
This is a good book.
This is a good book.
This is a good book.
This is not a good book.
This is a good book, the other one is better.
This is a good book.

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 Programming Questions!