I will be short.
I am making a program in MIPS which intake Strings of 15 chars from user. I am unable to save the string on stack. Note the I am using a 2D Matrix [20][15] where 20 are string and each string have 15 character.
Please guide me. I have been trying this over the past 10 hours.
Loop:
bgt $t2,20,XYZ
li $v0,8 #take in input
la $a0, buffer #load byte space into address
li $a1, 15 # allot the byte space for string
syscall
move $t3,$a0 #save string to t0
#transfering the data onto stack!
#num = $t2
#$base address of Matrix = $t1
#colums of Matrix = 15
mul $s0,$t2,15 #num * colums
li $s1,4 #String have 4 bit!
mul $s0,$s0,$s1
add $s0,$s0,$t1 #$t1 is the base address!
#storing the data onto the stack!
sw $t3,0($s0)
add $t2,$t2,1
add $s0,$s0,-15
j Loop