We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I have a macro:
#define EnterCritical() do { SP++; *(unsigned char idata *)(SP-1) = IE; EA = 0; } while (0);
For personal preference I prefer the structured approach where I can clearly see the acquistion & release of this resource. Jon Ward's idea of using "#pragma disable" is even cleaner (but uses 1 byte vs 1 bit of ram and is slightly bigger in code). Of course if you need the speed, just save the IE bit when you acquire the interrupt lock and restore IE when you release the lock.
I agree, your method gives finer-grain control. Andrew