MIPS跳转指令范围 [英] MIPS range of jump instruction

查看:789
本文介绍了MIPS跳转指令范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在读这本书'计算机组织与设计"由Patterson和Hennessy提出,并对MIPS感兴趣.

I am reading the book 'Computer Organization and Design' by Patterson and Hennessy and got interested in MIPS.

我对查找跳转/分支指令的范围存有疑问.同样在确定到达特定地址所需的分支/跳转指令的数量中.

I have doubts in finding the range of a jump/branch instruction. Also in determining the number of branch/jump instructions required to get to a specific address.

有人可以提供关于如何计算该值的解释,即考虑在特定地址使用PC并找到前往不同地址所需的分支/跳转指令数量吗?例如,如果PC在0x10001010处,那么分支指令和跳转指令的地址范围是什么?

Can someone provide an explanation of how this has to be calculated i.e. Considering PC at a specific address and finding the number of branch/jump instructions needed to go to a different address? For example, what if PC is at 0x10001010, what is the range of addresses of branch and jump instructions?

或者您可以将我定向到一些在线资源或书籍,这将有助于我更好地理解这些资源或书?

Or can you direct me to some online resource or book which would help me in getting a better understanding of these?

推荐答案

以下是MIPS-32的全部内容.

The following is all for MIPS-32.

分支B, BEQ, BNE, etc.指令具有16位带符号的 word 偏移字段,允许从当前位置跳转到地址+/- 128kByte.跳转J指令指定了PC的最高4位:26≤2位(这是不是相对地址)所指定的当前256MByte区域内的地址.要跳转到4GB地址空间中任意位置的任意地址,请使用JR(跳转寄存器),它跳转到通用寄存器中包含的地址.

Branch B, BEQ, BNE, etc. instructions have a 16 bit signed word offset field, allowing a branch to an address +/- 128kBytes from the current location. A jump J instruction specifies an address within the current 256MByte region specified by PC's most significant 4 bits : 26<<2 bits(this is not a relative address). To branch to an arbitrary address anywhere in the 4GB address space, use JR (jump register) which jumps to an address contained in a general purpose register.

它需要一条跳转指令或跳转指令,或者先加载寄存器再跟随JR,以跳转到任意地址,具体取决于该地址有多远.

It takes either a single branch or jump instruction, or a register load followed by a JR to jump to an arbitrary address, depending how far away the address is.

关于MIPS编程的最佳书籍仍然是 请参阅MIPS运行 .您还可以在 mips.com 上找到MIPS体系结构参考手册. (需要注册).最相关的文档是面向程序员的MIPS32®体系结构第二卷:MIPS32®指令集.

The best book for MIPS programming is still See MIPS Run. You can also find MIPS architecture reference manuals at mips.com (registration required). The most relevant document is MIPS32® Architecture for Programmers Volume II: The MIPS32® Instruction Set.

这篇关于MIPS跳转指令范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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