15.3 Specifying the Interrupt Vector

All DSC-bit devices have a primary interrupt vector table. Some DSC-bit devices have a fixed alternate vector table, some have no alternate vector table and some have an alternate vector table which may be disabled and moved.

Note: A device Reset is not handled through the interrupt vector table. Instead, on device Reset, the program counter is cleared. This causes the processor to begin execution at address zero. By convention, the linker script constructs a GOTO instruction at that location which transfers control to the C run-time startup module.

The alternate vector name is used when the ALTIVT bit is set in the INTCON2 register. For devices with alternate vector tables which may be disabled and moved, AIVT support is configured via configuration words, notably:

  • AIVTDIS to enable the vector table
  • BSLIM to locate the vector table

On these devices, the tool chain will inspect the values of these configuration words to determine whether or not to allocate space and fill in the value of the alternate vector tables. Simply specify device appropriate values for these configuration words:

#pragma config AIVTDIS = ON

#pragma config BSLIM = 0x1FFD

and define the alternate vectors in the normal way, i.e.:

void __attribute__((interrupt)) _AltT1Interrupt(void) {}

Each exception vector occupies a program word. For tables of interrupt vectors by device family, see the 15.3.2 Interrupt Vector Tables section.