mips运行时异常位于0x00400004:地址超出范围0x00000000

我正在尝试学习技巧,对此有点陌生:P 当我尝试运行此代码时,它会给我“ Runtime exception at 0x00400004: address out of range 0x00000000” 在lb $t2,0($t0)上。我在做什么错了?

    .data
    .text
    .globl strlen


strlen: li $t1,0        # len = 0;
    move $t0,$a0       # $a0 = char*s
    lb $t2,0($t0)
while:          # while(*s++ != '\0')
    beq $t0,'\0',endw
    addiu $t0,$t0,1     #
    addiu $t1,$t1,1
    lb $t2,0($t0)
    j while             # }
endw:   move $v0,$t1        # return len;
    jr $ra 
yinguang120 回答:mips运行时异常位于0x00400004:地址超出范围0x00000000

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3165517.html

大家都在问