SNIU028D February 2016 – September 2020 UCD3138 , UCD3138064 , UCD3138064A , UCD3138128 , UCD3138A , UCD3138A64
This chapter explains how to set certain sections of code to operate in Thumb (16 bit) or ARM (32 bit) mode.
The ARM7TDMI-S (in UCD3138) is a unique processor in that it offers the performance of a 32-bit architecture with the code density of a 16-bit architecture. This is achieved by supporting both a 16-bit instruction set and a 32-bit instruction set and allowing switching dynamically between the two sets.
As explained earlier in reference to Table 14-3, which illustrates the structure of CPSR register in ARM7TDMI-S, the working state is determined by Bit-5 (the T bit).
The instruction set that the ARM7TDMI-S processor uses is determined by the state of the processor. The processor can be in 32-BIS (bit instruction set) state or 16-BIS state at any given time. The compiler allows the user to specify whether a module should be compiled in 32- or 16-BIS state and allows functions compiled in one state to call functions compiled in the other state.