You can mix and match ARM and Thumb code within the same binary. This is called interworking and it lets you exploit the strengths of each instruction set.
- The bulk of your code could be written in Thumb, to minimise binary size.
- Performance critical parts could be written in ARM, for speed.
The ‘T’ bit in the CPSR register signals Thumb mode.
- Switch between modes with
- Special form of branch instruction.
- Bottom bit of Rm becomes the T bit.
ARMv5T and later architectures add:
- and other changes which make interworking much more pleasant.