Westonci.ca is the best place to get answers to your questions, provided by a community of experienced and knowledgeable experts. Explore our Q&A platform to find in-depth answers from a wide range of experts in different fields. Get quick and reliable solutions to your questions from a community of experienced experts on our platform.

palindrome.s is

# read a line and print whether it is a palindrom

main:
la $a0, str0 # printf("Enter a line of input: ");
li $v0, 4
syscall

la $a0, line
la $a1, 256
li $v0, 8 # fgets(buffer, 256, stdin)
syscall #


la $a0, not_palindrome
li $v0, 4
syscall

la $a0, palindrome
li $v0, 4
syscall

li $v0, 0 # return 0
jr $ra


.data
str0:
.asciiz "Enter a line of input: "
palindrome:
.asciiz "palindrome\n"
not_palindrome:
.asciiz "not palindrome\n"


# line of input stored here
line:
.space 256