enter image description here
The MIPS simulator keeps telling me there is an error. This was the question: A palindrome is a string that reads the same backwards and forwards. For example, each of the
following strings is palindrome: noon, civic, radar, level, and rotor. Write a MIPS program
that reads in a string from the data section and determines whether or not it is a palindrome.
Your program should declare a string in the data section as follows:
.data
string: .asciiz “put the string here”
The strings are stored in the memory according to C-style which means they are null-terminated.
A null-terminated string is a sequence of ASCII characters, followed by a zero byte (0x00).
The length of the string should be computed in the first part of the program by scanning the
characters till the null character ‘’ is found. The length must be stored in register r8.
The second part of the program uses the length stored in r8 and determines whether the string
contains a palindrome or not. The result must be stored in register r9 as follows: 0 for no
palindrome and 1 for palindrome.
EngineeringStudent is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.