First and foremost, understand you make no contribution to this forum by replying to every thread with 'read the manual'. If you do not wish to answer the question, simply dont answer it. To answer the question, KEIL C has the commands (probably for good reason) : _push_ _pop_ defined in <intrins.h> Remember push/pop can SAVE or RESTORE any special function register.
"you make no contribution to this forum by replying to every thread with 'read the manual'" And what contribution do you make by providing an "answer" with no reference to any corresponding question?!
"Remember push/pop can SAVE or RESTORE any special function register." Also remember that you have absolutely no control whatsoever of what else the compiler may be PUSHing and POPping, nor when it might be doing it! Therefore, to insert abitrary PUSHes and POPs into 'C' source code must be regarded as dangerous in the extreme!! :-0 See http://www.keil.com/forum/docs/thread7162.asp#msg33283
A local variable often makes a good alternative to push'ing and pop'ing from C. For example:
void MyFunc (void) { // accesses slow devices U8 oldCkcon = CKCON; CKCON = SlowCkcon; // slow accesses here CKCON = oldCkcon; // normal speed }
void MyFunc (void) { // some variables // some code that runs fast { // slow access region U8 oldCkcon = CKCON; CKCON = SlowCkcon; // slow accesses here CKCON = oldCkcon; } // end of slow access // more code here that runs fast }