Write two string words and add them in one sentence (MIPS)

255 views Asked by At

i wrote this code and i want to add them in one sentence for my project i tried many solution but didn't work and i have two days only

  data
word1: .asciiz "Enter the first word please: " "" 
word2: .asciiz "Enter the second word please: " ""  
result: .asciiz "Your sentence is: " "" 
buffer: .space 256

there the example Enter the first word please: Hi
"Enter the second word please: There
"Your sentence is:HI There

.text
main:
# hold first word 
# hold second word
# hold result

li $v0,4 #print String
la $a0,word1 #
syscall
li $v0,8 #read String
syscall

#word two
li $v0,4
la $a0,word2
syscall
li $v0,8
syscall
li $v0,4

#print output
la $a0,result
li $v0,4
syscall
la $a0,buffer 

end:
li $v0,4
syscall
li $v0,10
syscall
0

There are 0 answers