目前我得到的输出为
dsajnd
不是回文
我希望它输出使得(例如dsajnd)和“不是回文”在同一行。
dsajnd 不是回文
我打印的代码是
true:
move $a3, $t0
la $v0, 4
syscall
# printing the true_msg, and exit.
la $a0, true_msg
li $v0, 4
syscall
b exit
false:
move $a3, $t0
la $v0, 4
syscall
la $a0, false_msg # printing the false_msg, and exit.
li $v0, 4
syscall
b exit
exit: ## exit the program:
li $v0, 10 # loading "exit" into $v0.
syscall
.globl Print_string
Print_string: # print the string whose starting address is in register a0
li $v0, 4
syscall
jr $ra
.data
buffer: .space 12
true_msg: .asciiz "is a palindrome"
false_msg: .asciiz "is not a palindrome"