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

问题描述

在"ARM11TechnicalRefManual"的第1-34节的"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指令集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-29 05:32