.data
org_str: .space 256
rev_str: .space 256
str: .asciiz "Enter the Line: "
pal: .asciiz "palindrome"
not_pali: .asciiz "Not palindrome"
.text
.globl main
main:
li $v0, 4
la $a0, str
syscall
# Taking String from the user
li $v0, 8
la $a0, org_str
li $a1, 256
syscall
# Initilize $t0 and $t2
li $t0, 0
li $t1, 0
loop_len:
add $t1, $a0, $t0
lb $t2, 0($t1) # Load the data in the byte in $t2
beqz $t2, len_exit # Loop …Run Code Online (Sandbox Code Playgroud)