Compressed Thumb instructions of ARM MCU
Thumb instructions Thumb instructions shrink ARM instructions from 32 bit to 16-bit length. This allows saving up to 40% of program memory comparing to the ARM instruction set. Maybe this is the main reason for Thumb instructions being used. Thumb instructions lose many properties of ARM instructions and become similar to traditional RISC instructions. Thumb instructions cant be conditional. Data processing has a two-address format where the destination register is one of the source registers. ARM instruction: ADD R0, R0, R1 Thumb instruction: ADD R0, R1 As the Thumb instruction set takes less program space, it allows to upload bigger applications, but with lower speed than using ARM, instructions performance is up to 40% faster. But in noncritical applications or functions speed isn’t a significant factor. Also, Thumb instructions don’t have full access to all registers. Thumb instructions can only access “low registers”(R0-R7). And only a few instructions can access “high registers”(R8-R12).