Difference between thumb Instruction Set and arm Instruction Set

Source: Internet
Author: User
Tags processing instruction
Thumb Instruction Set
 
The thumb command can be seen as a subset of arm commands in the form of compression. It is proposed for the code density [1] and has a 16-bit code density. Thumb is not a complete architecture and cannot expect the processing program to execute only thumb instructions rather than arm instruction sets. Therefore, the thumb command only needs to support general functions. If necessary, you can use a complete arm instruction set. For example, all exceptions automatically enter the arm status.
When writing the thumb command, you must first use the pseudo command code16 Declaration, and in the arm command, you must use the Bx command to jump to the thumb command to switch the processor status. When writing arm commands, you can use the pseudo command code32 statement.
 
[1]. Code density: the number of commands contained in the unit bucket. For example
The arm command is 32-bit, while the thumb command is 16-bit. If it is in a 1 K bucket, you can put 32 arm commands and 64 thumb commands, therefore, the Code density is high when the Thunb command is stored.
 
 
 
Difference between thumb Instruction Set and arm Instruction Set
 
The thumb instruction set does not contain coprocessor instructions, semaphore commands, and instructions for accessing CPSR or spsr. It does not have multiplication instructions or 64-bit multiplication instructions, and the second operand of commands is limited; except for the conditional execution function of redirect command B, all other commands are executed unconditionally. Most thumb data processing commands use the 2-address format. The differences between the thumb Instruction Set and the arm instruction set are as follows:
? Jump command
Programs are relatively transferred. In particular, conditional jumps have more restrictions than those in arm code. The conversion subroutine is unconditional.
? Data processing commands
Data processing commands operate on General registers. In most cases, the operation results must be placed in one of the operand registers, rather than the third register.
Less data processing operations than arm States, access register R8-R15 is limited.
(Except mov and add commands access register R8-R15, other data processing commands always update the ALU status flag in CPSR)
The thumb Data Processing Instruction that accesses the register R8-R15 cannot update the ALU status flag in CPSR
? Single Register loading and storage commands
In thumb state, single register loading and storage commands can only access register R0-R7
? Batch register loading and storage commands
The LDM and STM commands can load or store any range of register subsets of the R0--R7

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.