Re: Clarification of Interrupt Control with p33FJ128MC706A
It is not interrupt nesting that is disabled, but any interrupts are disabled altogether. 'disi' is an assembler instruction that disables the recognition of interrupts for the specified number of instruction cycles. Using the parameter of 0 enables the interrupts to be recognised again.
If you are using the XC16 compiler, then you can also use the '__builtin_disi()' macro.
The reason this is done is often when you must make sure that an operation is (in effect) atomic. In this case you want to make sure that the pointer dereferencing and value updating all occur without being interrupted by some code that might (for example) update 'size' or the 'dataSize' values. Also, depending on the size of the values, it might take several CPU instructions to retrieve/store the value and you don't want and ISR changing (say) the top part of a value after you have read it.