So i'm trying to program the Rot47 algorithm in MIPS
.data
message: .asciiz "This text should probably contain something useful!"
message_size:.word 51
.text
main:
li $t1, 0
la $t0, message
loop:
lb $a0, 0($t0) #load the first ascii-char of the string
beqz $a0, done
addi $t0, $t0,1
addi $t1, $t1,1
j rot47
rot47:
sb $t3, 0($a0) #store the first ascii-char into $t3
ble $t3, 79, do #$t3 <= 79 do $t3 + 47
sub $t3, $t3, 47 #else $t3 - 47
j next
here is where i face my first hurdle "line 19(sb $t3, 0($a0)): Runtime exception at 0x00400020: address out of range 0x00000054"
what exactly does that mean? its supposed to be a zero terminated string to store characters.
do:
addi $t3, $t3, 47
j next
next:
addi $a0, $a0, 1 #increment $a0 for the next byte
j loop
done: #print the completed string
li $v0, 4
add $a0, $0, $t3
syscall
li $v0, 10
syscall
I commented my code a little to make my steps a little bit clearer