Dual-State Interworking
462
SNIU028A – February 2016 – Revised April 2016
Copyright © 2016, Texas Instruments Incorporated
ARM7TDMI-S MPUSS
where BX stands for Branch and Exchange instruction set.
BX r0 assembly instruction derives the target state from bit[0] of r0:
•
if bit[0] of r0 is 0, the processor changes to, or remains in, ARM state
•
if bit[0] of r0 is 1, the processor changes to, or remains in, Thumb state
When code is written in C language, the CCS compiler can be directed to build parts of the code in ARM
or Thumb mode. This is done through utilization of “--code_state={16|32}” or “-mt“ compiler build options.
•
--code_state={16|32} Designates code state as 16-bit (thumb), or default 32-bit (arm)
•
-mt Designates code state as 16-bit (thumb) mode
Therefore “--code_state=16” and “-mt” have identical effect.
shows the build options for the
entire project.
Figure 14-1.
It can be seen that the “Code State Mode” is set to none, but the “–mt” compiler option is added in the
long statement of all compiler built options shown in the upper editable field of the window.
The “–mt” option can be added by selecting the “16-bit State Code (-mt)” check box under the advanced
category. This is illustrated in
.