invalid program counter value: 0

前端 未结 3 1309
伪装坚强ぢ
伪装坚强ぢ 2021-01-21 04:44

I\'m currently working with assembly language under the MIPS processor. I\'m currently using MARS simulator and for reasons unknown I get the following error message after every

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-21 05:27

    You probably finish your program with a jr $ra (return to caller). However, the code executed by MARS doesn't have a caller - it's executed at startup and has no function to return to, so the contents of $ra are zero.

    The correct way to end a program on MARS is using the "exit" syscall:

        li $v0, 10
        syscall
    

提交回复
热议问题