Function attributes

A number of special function attributes are supported, to provide access to the special features of the MSP430, and the special needs of embedded programming.

reserve(x)When applied to main(), this reserves "x" bytes of RAM above the stack. This cannot be used with C++ (if C++ is supported later on).
interrupt(x)Make the function an interrupt service routine for interrupt "x".
signalMake an interrupt service routine allow further nested interrupts.
wakeupWhen applied to an interrupt service routine, wake the processor from any low power state as the routine exits. When applied to other routines, this attribute is silently ignored.
nakedDo not generate a prologue or epilogue for the function.
criticalDisable interrupts on entry, and restore the previous interrupt state on exit.
reentrantDisable interrupts on entry, and always enable them on exit.
saveprologueUse a subroutine for the function prologue, to save memory.
noint_hwmulSupress the generation of disable and enable interrupt instructions around hardware multiplier code.

The syntax for using these attributes is "__attribute__((attribute_name(x)))", where "attribute_name" is replaced by the required attribute name, and "x" is replaced by a parameter to that attribute. For attributes which do not accept parameters, "(x)" should be omitted.

The header file "signal.h" defines a number of alternative names for some of these attributes. In the sections below, some of these alternative names are used in more detailed discussions of the use of these attributes.