Like the title states, I have one "template" string that I want to copy to another string so as to "reset" the string. Here is an example of what I'm trying to do:
I have these two strings at the start:
.data
blank: .asciiz "-/-/-/-/-/"
gameBoard: .asciiz "-/-/-/-/-/"
I start off with these two strings, but then I modify gameBoard so it might look something like this:
"X/X/-/O/X/"
But now I want to reset the string so to speak, so it will look like 'blank', but I can't seem to properly copy the string over. Here's the code I tried, but I only managed to cause the console to enter an infinite loop and freeze:
resetGameBoard:
li $t0,0
lb $t1, blank($t0)
sb $t1, gameBoard($t0)
add $t0, $t0,1
blt $t0, 10, resetGameBoard
j main
Any help would be greatly appreciated!