Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我必须在不使用 J-Type 指令的情况下将 jal 指令实现为伪指令。我可以用 jr 来实现它,但我知道 jal 将当前的 PC+8 存储在 $ra 中。我该如何实施?如何在没有 J-type 的情况下将 PC 地址存储在 ra 中?
尝试这个:
la $ra, ret # load return address (pseudo instruction!) j dest # call the function nop # delay slot ret: # return here ... dest: # destination function ... jr $ra