I want to minimize interrupt latency by using #pragma noframe in my interrupt routines. Can I safely omit the saving and restoring of the DPP0 and DPP2 registers?
Currently, when compiling for small model and not accessing any far/huge data in your application, you can safely assume that DPP0 and DPP2 will never change at runtime. Hence, saving/restoring these registers on an interrupt is redundant and you can use ‘#pragma noframe’ to suppress the compiler-generated interrupt prologue/epilogue. However, when you do have far/huge data, there is no guarantee that DPP0 and DPP2 will remain untouched at runtime. The extended instruction set contains instructions for temporarily overriding pages and segments. Even when the extended instruction set is enabled, the compiler might generate code which touches DPP0 at runtime. Furthermore, the compiler might generate code with calls to runtime library routines which touch DPP0 and/or DPP2. These are routines for moving/copying data among near/far/huge memory: cpffb cpffw cpfhb cpfhw cpfnb cpfnw cphfb cphfw cphhb cphhw cphnb cphnw cpnfb cpnfw cpnhb cpnhw Conclusion: To be safe, you are suggested not to min