A small project that we have to do in MIPS using mars linux is to make 4 different versions using this basic code that the teachers gave us but the problem is that in school it works when i try it home it gives me
Runtime exception at 0x00400028: address out of range 0x00000000
this would be located at B0_7
integer_to_string_v0: # ($a0, $a1, $a2) = (n, base, buf)
move $t0, $a2 # char *p = buff
# for (int i = n; i > 0; i = i / base) {
move $t1, $a0 # int i = n
B0_3:
blez $t1, B0_7 # si i <= 0 salta el bucle
div $t1, $a1 # i / base
mflo $t1 # i = i / base
mfhi $t2 # d = i % base
addiu $t2, $t2, '0' # d + '0'
sb $t2, 0($t0) # *p = $t2
addiu $t0, $t0, 1 # ++p
j B0_3 # sigue el bucle
# }
B0_7:
sb $zero, 0($t0) # *p = '\0'
B0_10:
jr $ra
$raregister contains the value 0, sojr $rajumps to an invalid address. You may want to issue asyscall10 to end the program instead. - gusbro