Customising the interrupt vector table

The interrupt vectors table is defined in the startup file for each device - "crtXXX". These files are automatically linked when a project is built. The tables are customised for the specific interrupt vectors present in each device. Undefined interrupts will result in a call to "_unexpected_1_", which branches to "_unexpected_". "_unexpected_" can be redefined in your code.

If you wish, you can completely customise the interrupt vector table, by defining your own, like this:

/* Define interrupt vector table */

INTERRUPT_VECTORS =
{
        zero_vector,
        zero_vector,
        zero_vector,
        zero_vector,
        zero_vector,
        zero_vector,
        wakeup_vector,
        zero_vector,
        zero_vector,
        zero_vector,
        zero_vector,
        zero_vector,
        zero_vector, 
        zero_vector,
        zero_vector,
        reset_vector
};
For this to work you must give the coomand line argument "'-nostartfiles'" to the gcc.