For instance, I have a program with this string:
str: .asciiz "abcdefghijklmnopqrstuvwxyz"
Then I put another letter at the end of the string by doing:
la $t0, str
sb $t1, 26($t0) # the letter a is stored into $t1
This makes the editted str to be:
str: .asciiz "abcdefghijklmnopqrstuvwxyza"
My question is how do I increment that number 26, to 27 because I have a loop that keeps accepting user inputted characters and adding it to the end of the string, but I keep replacing the last letter of the string with the new letter. I want to increment the 26 by 1 every time it loops once so that the string keeps lengthening, not being replaced by other letters. The only thing I can think of is
sb $t1, $t2($t0)
add $t2, $t2, 1
which doesn't work.