My program is a bitter large.When I select "keep variables in order" which is located in the option of a project,my program will run normally,though very slowly.Otherwise ,errors will occur.Why? Thanks for your answer.
Uninitialised and/or corrupt pointers would be one thing to look for. --What are corrupt pointers? Mismatched PUSH/POP would be another. --None.I use C. Are you calling functions recursively without specifying them as reentrant? --None Are you calling any functions via pointers? --None Do you get any warnings when you build? --None
--What are corrupt pointers? If you have a valid pointer and do some math on it, say increment it past the end of the memory block it actually belongs to, you could call it a corrupt pointer. However, this is not a C term. Your pointer either points to valid memory (that is, what you expect it to), junk (someone else's memory), or null (nothing). - Mark
Yes, by "corrupt pointer" I meant a pointer which points where it didn't oughta! It wasn't intended to be a specific 'C' term. Note that, with C51, a pointer specifies both an address and (either implicitly or explicitly) a memory area - DATA, XDATA, etc If the "corrupt" part of a "corrupt" pointer is the memory area, it could end up pointing into the stack - imagine what fun that can be...! You probably need to track this down in the simulator.