Keil Logo

__thumb: Thumb Function

Thumb coded functions are defined using the __thumb function attribute.

<[>type<]> funcname (<[>args<]>) __thumb


type is the type of the value returned from the function. If no type is specified, int is assumed.
funcname is the name of the function.
args is the argument list for the function.
__thumb indicates the function is coded with the Thumb instruction set.

For example:

void MyARMfunc (void) __thumb  {    // use Thumb code for following function
  l = x + 4;


  • The __thumb attribute switches the CARM Compiler to THUMB mode even if the ARM mode is selected.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.