Introduction to ARM

Interworking

You can mix and match ARM and Thumb code within the same binary. This is called interworking and it lets you take advantage of the strengths of each type of code.

For example:

  • The bulk of the code could be written in Thumb, to keep the overall binary size down.
  • Performance critical parts could be written in ARM, for speed.

The ‘T’ bit in the CPSR register signals Thumb mode.

  • Switch between modes with BX Rm.
  • Special form of branch instruction.
  • Bottom bit of Rm becomes the T bit.

ARMv5T and later architectures add:

  • BLX <Rm|label>
  • and other changes which make interworking much more pleasant.

Navigate