la $s0,0($a0) #load address of first input string
la $s1,4($a0) #load address of second input string
lw $s2,8($a0) #load address of result
lw $s3,12($a0) #load size value
#break when offset equals zero
#get characters at offset
#add results with carry over
#subtract 1 from offset
#calculate carry by result % 10
#store byte at offset
#loop again
move $t0,$zero
add $t0,$s3,$t0 #calculate offset
addi $t0,$t0,-1
add $s0,$s0,$t0
lb $s5,0($s0)
sb $s5,0($s2)
我将字符串的最后一个字符存储在s2中。当字符串只有1个字节长时,我可以打印出最后一个字符,但是当字符串更长时,我可以打印出来。它说我引用了未对齐的记忆。