現在、次のように出力されます
ダジャンド
回文ではない
そして、(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"