Question: Write a program to check if a null terminated string stored in memory starting at location x5000 is a palindrome. Note that what is being

Write a program to check if a null terminated string stored in memory starting at location x5000 is a palindrome. Note that what is being store in memory is the ASCII value of each character. Store 1 in memory location x6000 if it is a palindrome, -1 otherwise. A palindrome is an expression that reads the same from left to right or from right to left. Spaces should be ignored and you can assume all letters are in upper case. Hint: compare the first and the last characters, then the second with the second last, and so on. Below is a suggested algorithm. You can also do it your own way. 1) Set R1 to point to the first character of the string, R2 to point to the last character. 2) Compare characters pointed to by R1 and R2 3) If they are the same, go to the next step. Otherwise, store -1 in memory location x6000 and stop

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