无条件分支和无条件跳转(MIPS中的指令)之间有什么区别? [英] What is the difference between unconditional branch and unconditional jump (instructions in MIPS)?
问题描述
您可以查看 Wikipedia 或
You may look into Wikipedia or short summary for students. Everybody says that there are two instructions for the same thing. But nobody tells why?
推荐答案
分支允许条件.但是允许条件会占用指令中的更多位.因此,分支的地址只有2 ^ 16位,并且只允许您向后分支2 ^ 15-1条指令或向前分支2 ^ 15条指令.
Branches allow for conditions. But allowing for conditions takes up more bits in the instruction. Therefore, a branch's address is only 2^16 bits and only allows you to branch 2^15 - 1 instructions backward or 2^15 instructions forward.
跳转是无条件的,通过忽略条件保存的位可以用作地址.跳转允许使用26位地址,因此在代码中跳转的距离比分支远得多.以没有条件为代价.
A jump is unconditional and the bits saved by leaving out the condition can be used for the address. A jump allows for a 26 bit address and so can jump much further in the code than a branch. At the expense of not being conditional.
这篇关于无条件分支和无条件跳转(MIPS中的指令)之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!