The dspic-utility.h header file defines a number of macros for manipulating the interrupt priority level (IPL) of the microcontroller, and for using the DISI instruction.
To use these macros, you can use the -I compiler option to add the dsPIC Helper Library source directory to the compiler command line, and then include the header file like so:
This macro raises the IPL to 7, disabling all maskable interrupts. The previous IPL is saved in a global variable for use by STI().
This macro restores the IPL to the value saved by the CLI() macro.
This macro raises the IPL to 7, disabling all maskable interrupts. Unlike CLI(), the current IPL value is not saved.
This macro emits the DISI instruction to disable interrupts for the maximum number of cycles. This macro can be used with DISI_CLEAR() to disable interrupts for a reasonably short, but unknown number of instructions.