For example, you have a string and a buffer:
text: .asciiz "111100010"
buffer: .space 1000
How do you convert each number to an ascii character and store them in a buffer?
i.e buffer should have this content: (ascii code of "1" is 49, "0" is 48)
494949494848484948
I know how to print them out individually since I can use syscall code 1 to interpret them as integers
main:
la $a0,text
j print
print_done:
li $v0,10
syscall
print: move $s0,$a0 #save addr
print_loop:
#addi $s0,$s0,20
lb $s1,($s0)
beqz $s1,print_done # check end of string
li $v0,1 # print as int
move $a0,$s1
syscall
addi $s0,$s0,1 # move forward
j print_loop
But these characters are printed out separately. How can I put them all in the buffer and print them all together?
Thank you!