i use c51 v7.5, when the code do : WFLAG = 0; // xdata unsigned long data type
the pragram get error! and i see the code called ?C?LSTKXDATA . then the ?C?LSTKXDATA did POP action..
why does the ?C?LSTKXDATA do this???
Sorry , i just mean 'ISR'.
because, i don't know why the function '?C?LSTKXDATA' did 'POP', when i write a function to do the clear operation by ASM, the MCU would not RESTART at all.
but also, the '?C?LSTKXDATA' was called by some other function, and it worked OK. -- there were not in a ISR.
sorry, i was replay to : http://www.keil.com/forum/docs/thread14140.asp#msg70496
i don't know why the function '?C?LSTKXDATA' did 'POP',
So stop worrying about that! The odds that a Keil-supplied library function which, as you noted yourself, works just fine in other places is buggy are far smaller than that the problem is in a completely different area, e.g. in your code, or in the way you set up that ISR ("using" used? correctly so?).
the MCU would not RESTART at all.
You still haven't found a single clue as to why it restarted, did you? That's what you have to concentrate on now. For starters: did you check if you got bit by your watchdog?
My money would be on stack overflow. Keil's service routine uses the stack quite a bit, whereas as your hand-coded replacement probably didn't.