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???
the pragram get error!
That doesn't even begin to be a usable description of your problem!
What is the error?
What makes you believe it shouldn't?
Put "LSTKXDATA" into the 'Search' box and find http://www.keil.com/support/docs/1964.htm
i used the code :
WFLAG = 0; // xdata unsigned long data type
in a ISP. and run at the code , the MCU restart.
at last, i use a function and writed by ASM, the MCU work OK.
when i debug the ?C?LSTKXDATA function , i see two 'POP' ASM code and with no 'POSH' code. so i didn't know how the code work.. like other function of "?C?tffmmm" there were no 'POP' code..
in a ISP.
You mean an ISR, I'll assume?
and run at the code , the MCU restart.
And you're totally sure that you know the Keil library function is responsible for that?
so i didn't know how the code work..
So you aren't sure. And given you don't know what the function does, there's no way you can justify your conclusion that it did it incorrectly.
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.