使用无条件的MIPS分支而不是跳转有什么好处吗? [英] Is there ever any advantage to using an unconditional MIPS branch rather than a jump?

查看:120
本文介绍了使用无条件的MIPS分支而不是跳转有什么好处吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在大学中学习MIPS汇编,并且正在努力尝试使用该语言.据我了解,跳转命令使我在内存中的跳转比分支命令给出的额外可用位更远.那为什么我为什么要使用无条件分支而不是使用跳转?

I am learning MIPS assembly at college currently, and am struggling to get a feel for the language. As I understand it, the jump command allows me to jump further in memory than a branch command would given the extra bits available. Why then would I ever use an unconditional branch rather than using a jump?

推荐答案

MIPS没有无条件分支.它可能是您的汇编器提供的伪指令,例如BEQ R1,R1.分支是可取的,因为它们允许代码位于内存中的任何位置,而无需 重定位 .在没有MMU的计算机上并希望实现共享库是理想的.对此维基百科文章的背景知识.

MIPS doesn't have an unconditional branch. It is probably a pseudo instruction provided by your assembler, like BEQ R1,R1. Branches are desirable because they allow code to be located anywhere in memory without requiring relocation. Desirable on machine without a MMU and to implement shared libraries. Backgrounder for that is in this wikipedia article.

这篇关于使用无条件的MIPS分支而不是跳转有什么好处吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆