Question

in Mips how do i get a input string from a user and then print it...

in Mips how do i get a input string from a user and then print it to the screen?

for example if a user enters A6B4GYJx how do i get that and then print it to the screen?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

#

.data
buffer: .space 20
str1: .asciiz "Enter string: "

.text

main:
la $a0, str1 # asking user for string
li $v0, 4
syscall

li $v0, 8 # reading input

la $a0, buffer
li $a1, 20   

move $t0, $a0 # save string to t0
syscall

la $a0, buffer
move $a0, $t0   
li $v0, 4   
syscall

li $v0, 10 # end program
syscall

data buffer: .space 20 stri: asciiz Enter string: .text # asking user for string main: la Sal, strl li $v0, 4 syscall li $

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
in Mips how do i get a input string from a user and then print it...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT