17.3.2 Interrupt-Pragma Vector Clause

Note: The interrupt pragma and its vector clause are provided only for compatibility when porting code from other compilers. The vector function attribute is the preferred way to associate a handler function to an exception vector address.

The interrupt pragma has an optional vector clause following the priority specifier.

# pragma interrupt function-nameIPL-specifier [vector [@]vector-number [, vector-number-list]]

A dispatch function targeting the specified handler function will be created at the exception vector address for the specified vector numbers. If the first vector number is specified with a preceding “@” symbol, the handler function itself will be located there directly.

For example, the following pragma specifies that function foo will be created as an interrupt handler function of priority four. foo will be located at the address of exception vector 54. A dispatch function targeting foo will be created at exception vector address 34.

#pragma interrupt foo IPL4AUTO vector @54, 34

The following pragma specifies that function bar will be created as an interrupt handler function of priority five. bar will be located in general purpose program memory (.text section). A dispatch function targeting bar will be created at exception vector address 23.

#pragma interrupt bar IPL5SOFT vector 23