什么是 ARM Thumb 指令集? [英] What is the ARM Thumb Instruction set?

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

问题描述

在ARM11TechnicalRefManual"第 1-34 节的The Thumb 指令集"下,它说:

under "The Thumb instruction set" in section 1-34 of "ARM11TechnicalRefManual" it said that:

Thumb 指令集是最常用的 32 位 ARM 指令的子集.Thumb 指令有 16 位长,并有相应的 32 位 ARM 指令,对处理器模型具有相同的影响."

"The Thumb instruction set is a subset of the most commonly used 32-bit ARM instructions.Thumb instructions are 16 bits long,and have a corresponding 32-bit ARM instruction that has the same effect on processor model."

谁能解释更多关于这尤其是第二句话并说处理器如何执行它?

can any one explain more about this especially second sentence and say how does processor perform it?

推荐答案

ARM 处理器有 2 个指令集,传统的 ARM 集,其中指令都是 32 位长的,而更精简的 Thumb 集,最常见的是指令长 16 位(有些指令长 32 位).开发人员可以选择要运行的指令集,并且只能激活一组指令(即,一旦处理器切换到 Thumb 模式,所有指令都将被解码为使用 Thumb 而不是 ARM).

The ARM processor has 2 instruction sets, the traditional ARM set, where the instructions are all 32-bit long, and the more condensed Thumb set, where most common instructions are 16-bit long (and some are 32-bit long). Which instruction set to run can be chosen by the developer, and only one set can be active (i.e. once the processor is switched to Thumb mode, all instructions will be decoded as using the Thumb instead of ARM).

虽然它们是不同的指令集,但它们共享相似的功能,并且可以使用相同的汇编语言来表示.例如,指令

Although they are different instruction sets, they share similar functionality, and can be represented using the same assembly language. For example, the instruction

ADDS  R0, R1, R2

可以编译为 ARM (E0910002/11100000 10010001 00000000 00000010) 或 Thumb (1888/00011000 10001000).当然,它们执行相同的功能(添加 r1 和 r2 并将结果存储到 r0),即使它们具有不同的编码.这就是Thumb指令长度为16位,对应的32位ARM指令对处理器模型有相同效果的含义.

can be compiled to ARM (E0910002 / 11100000 10010001 00000000 00000010) or Thumb (1888 / 00011000 10001000). Of course, they perform the same function (add r1 and r2 and store the result to r0), even if they have different encodings. This is the meaning of Thumb instructions are 16 bits long,and have a corresponding 32-bit ARM instruction that has the same effect on processor model.

Thumb 编码中的每条*指令在 ARM 中也有相应的编码,即子集"语句的意思.

Every* instruction in Thumb encoding also has a corresponding encoding in ARM, which is meant by the "subset" sentence.

*:不严格,ARM中没有IT"指令,尽管ARM无论如何都不需要IT"(它会被汇编程序忽略).

*: Not strictly true, there is not "IT" instruction in ARM, although ARM doesn't need "IT" anyway (it will be ignored by the assembler).

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

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