私は短くなります。
ユーザーから15文字の文字列を取り込むMIPSでプログラムを作成しています。文字列をスタックに保存できません。2D マトリックス [20][15] を使用していることに注意してください。ここで、20 は文字列で、各文字列は 15 文字です。
私を案内してください。私は過去10時間にわたってこれを試してきました。
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