There are two arm instruction sets and thumb instruction sets.
The arm instruction set is 32-bit long and has the most complete functions. The thumb instruction set is 16-bit long and can implement most of the functions of the arm instruction set.
Thumb instruction set is extremely highCodeDensity (reduced by 30% on average ).
The ARM processor has two processor states that correspond to the two sets of instruction sets respectively.
ToProgramThe control bit t in the Status Register CPSR reflects the state in which the processor is operating, that is, which instruction set is being executed. When T = 0, the processor is in the arm State and executes the arm command. When T = 1, the processor is in the thumb state and executes the thumb command. The processor is in the arm State by default when the system is powered on.
Regardless of the status of the processor, the arm Instruction Set and the thumb instruction set are both used.
The BX command can switch the operating status of the ARM Kernel Between arm and thumb.
PS: usage of BX.
Bx: A jump command with status switch to jump to the address specified by RM to execute the program. If the RM bit [0] is 1, the flag t of CPSR is automatically set during the jump, that is, the code of the target address is interpreted as the thumb status code. If the RM bit [0] is 0, the flag t in CPSR is automatically reset during the jump, the code of the target address is interpreted as arm code. The command format is as follows,
BX {cond} RM
These two command systems were designed to allow users to better control the amount of code.