How to print a string and another string variable in same line in MIPS?

Chinmay

Currently I get output as

dsajnd

is not a palindrome

And I want it to output such that the (e.g dsajnd) and " is not a palindrome" are on the same line.

dsajnd is not a palindrome

the code I have for printing this is

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"
qwr

Whatever string you have must have a newline or line feed at the end. You need to remove that. MIPS will not automatically add newlines unless you explicitly tell it to.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I print variable and string on same line in Python?

How can I print variable and string on same line in Python?

How to print string variable as f string in python

Printing integer variable and string on same line in SQL

Print string and variable contents on the same line in R

Java: How to print the next line of found string

Print variable line by line with string in front Python 2.7

Regex that matches a string but only if another string is not present anywhere on the same line

How to write to print string variable and a looped range variable together in one line

How can i print these 2 string, one in a line and the other on another?

In c# how do i print a string in the same line, replacing the string each time i print the result?

Awk - how to print variable with string

How to print an string without the newline Mips Assembly language

How to print a line if that line or the next line do not contain a particular string

How to print a string in a list and its index on the same line?

Regex - Find string in line but replace another string in the same line

MIPS- How to add one string to another

Print line having two instances of same string in same line

How to print the string variable in mysql

Java print string and int on same line

How to print multi-line string into a blob?

How to print a string with a variable in Ballerina?

If string in one file matches string in another, print line and next line

How to modify and print a string in MIPS?

How to print a variable that has the same name as an inputted string?

How do I add both a variable and a string into the same print statement?

awk if same string then print in 1 line

How to print a specific line in string Python?

How to check for variable character in string and match it with another string of same length?