什么FUNC在R-格式的指令来设定? [英] What does func means in R-Format instruction set?

查看:684
本文介绍了什么FUNC在R-格式的指令来设定?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很新的汇编语言即可。我正在读关于 MIPS 架构和我坚持在注册格式(R-格式)的最后一个字段。下面是它的视觉重新presentation,

任何人都可以请帮我出的什么是第六场手段并如何计算呢?
先谢谢了。

I am very new to Assembly language. I was reading about MIPS architecture and I am stuck with the last field of the Register Format (R-Format). Here is its visual representation, Can anyone please help me out with what does the sixth field means and how do we calculate it? Thanks in advance.

推荐答案

由于说明提及的所有R型的指令(如添加键, SLL 等)必须设置为0 6最显著位(= OP),这意味着他们是为了区别开来的唯一途径看6至少显著位(= FUNCT)。换句话说,他们确定的指令类型。也许一个例子帮助。

As the description mentions all R-type instructions (e.g. ADD, AND, SLL and others) have the 6 most significant bits (= op) set to 0, that means the only way to distinguish between them is to look at the 6 least significant bits (= funct). In other words they determine the the instruction type. Perhaps an example will help.

ADD $1, $2, $3 

有:

op = 0 (as all R-type instructions)
rs = 2
rt = 3
rd = 1
shamt = 0
funct = 0x20 = 0b00000100000 = 32

编码将因此是:

0000 0000 0100 0011 0000 1000 0010 0000

有关如 XOR (另一种R型)指令FUNCT是 0b100110 = 0×26 = 38 。所以,你通过查找你要带code什么指令计算了。

For e.g. XOR (another R-type) instruction funct is 0b100110 = 0x26 = 38. So you "calculate" it by looking up what instruction you want to encode.

(从 MIPS指令参考拍摄)。

这篇关于什么FUNC在R-格式的指令来设定?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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