Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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?

0
Posted

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?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123