指令大小是什么意思? [英] What Do we mean by instruction size?

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

问题描述

我真的很困惑,可能听起来有些愚蠢,但是我真的不确定当我们说指令大小为32位或指令为16位时是什么意思.

I am really consfused and may sound dumb question but I really not sure what does it mean when we say an instruction size is 32 bit or instruction is 16 bit .

如果opreand的大小是32位,那么就说它是32位指令,如果操作数是16位的指令.

Is it if opreand size is 32 bit then we say it's an 32 bit instruction and if operand size is 16 bit instruction.

或者每条指令都有操作码,如果操作码地址是32位,那么我们说指令是32位.

Or every instruction has opcode and if opcode addres is 32 bit then we say instruction is 32 bit.

我还将经历ARM架构,在该架构中,我读取的所有Thumb指令均为16位,而ARM模式指令为32位.

I am also going through ARM architecture where I read all thumb instruction are of 16 bit but ARM mode instruction are 32 bit .

指令大小完全取决于所使用的体系结构还是取决于CPU的工作模式?

Is Instruction size totally depend upon the Architecture in use or it depends modes in which CPU operates??

http://www.xgc-tek.com/手册/m1750-ada/m1750/x524.html

Given Link建议16位指令由8位操作码和2个通用寄存器的4 + 4位组成.

Given Link suggets that 16 bit instruction is composed of 8 bit of opcode and 4+4 bits of two General Purpose register.

ARM拇指指令集如何实现?

How is it true for ARM thumb instruction set??

推荐答案

ARM(不包括新发布的64位)具有两个指令集,这些指令集由固定大小的指令组成.经典的一种称为ARM,每条指令均为32位.后来的一种称为Thumb(实际上是Thumb2),它可以具有32位或16位指令.有一些ARM内核仅支持ARM,ARM + Thumb和Thumb指令集.如果内核同时支持两种模式,则它具有更改活动指令集选择的指令,并且指令流可以在不同的指令集之间跳转(互通).

ARM (excluding newly released 64-bit) has two instruction sets which are consisting of fixed sized instructions. Classical one is called ARM and each instruction is 32-bit. Later one is called Thumb (in fact Thumb2) which can have 32-bit or 16-bit instructions. There are ARM cores which supporting only ARM, ARM+Thumb and only Thumb instruction sets. In case a core support both modes, it has instructions to change active instruction set selection and instruction streams can jump between different sets (interworking).

ARM指令可以包含固定的操作数,但是它们永远不能与指令大小一样大.有些指令还支持对操作数的操作,例如移位,旋转等,给您的印象是可以用一条指令加载32位值.

ARM instructions can contain fixed operands however they can never be as big as instruction size. Some instructions also support operations on operands like shifting, rotating which gives you impression that it is possible to load 32-bit values with a single instruction.

示例1

a = 0x1;

拇指

2001        movs    r0, #1

ARM

e3a00001    mov r0, #1

示例2

a = 0xC0000000;

拇指

f04f 4040   mov.w   r0, #0xC0000000

ARM

e3a00103    mov r0, #0xC0000000

示例#3

a = 0x12345678

拇指

f245 6078   movw    r0, #0x5678
f2c1 2034   movt    r0, #0x1234

ARM

e3050678    movw    r0, #0x5678
e3410234    movt    r0, #0x1234

这篇关于指令大小是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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