32-bit Arm and Thumb code
In 32-bit mode, the IAR C/C++ Compiler for Arm can generate code for either the 32-bit Arm, or the 16-bit Thumb or Thumb2 instruction set. Use the ‑‑cpu_mode option, alternatively the ‑‑arm or ‑‑thumb options, to specify which instruction set should be used for your project. For individual functions, it is possible to override the project setting using the extended keywords __arm and __thumb. You can freely mix Arm and Thumb code in the same application.
When performing function calls, the compiler always attempts to generate the most efficient assembler language instruction or instruction sequence available. As a result, 4 Gbytes of continuous memory in the range 0x0-0xFFFF'FFFF can be used for placing code. There is a limit of 4 Mbytes per code module.
The size of all code pointers is 4 bytes. There are restrictions to implicit and explicit casts from code pointers to data pointers or integer types or vice versa. For further information about restrictions, see Pointer types.
In the chapter Assembler language interface, the generated code is studied in more detail in the description of calling C functions from assembler language and vice versa.