Keil Logo

Function Declarations

The C251 Compiler provides a number of extensions for standard C function declarations. These extensions allow to:

  • Declare a function as an interrupt procedure
  • Set the register bank
  • Select the memory model
  • Declare a reentrant function
  • Declare alien functions

You can include these extensions or attributes (many can be combined) in the function declaration. Use the following format for declaring functions:

return_typefuncname (〚args〛) 〚{small |  large}〛
                                    〚__attribute__ ((attrib_spec))〛
                                    〚interrupt n〛
                                    〚using y


return_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.
small explicitly defines the function uses the small memory model.
large explicitly defines the function uses the large memory model.
__attribute__ is a keyword followed by an attribute specification. Refer to Attributes for more information.
attrib_spec is an attribute specification enclosed by double-brackets. For example, noreturn. Refer to Attributes for the complete list of attributes specifications.
reentrant indicates that the function is recursive or reentrant.
interrupt indicates that the function is an interrupt function.
n is the interrupt number.
using specifies which register bank the function uses.
y is the register bank number.

Descriptions of these attributes and other features are described in detail in the following topics.

  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.