Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/22/04 09:55
Read: times


 
#63115 - RE: Function pointer and call tree in Keil
Responding to: ???'s previous message
the stack which gets return addresses pushed onto it each time is overflowing until it crashes.


There is another mechanism in Keil (and probably other 8051 compilers) that can crash your app long before the stack overflows!

It is because Keil C51 does not use the processor's hardware stack for parameters or local variables - it uses fixed memory locations instead.
Obviously, this makes everything inherently non-reentrant!

This also makes some big issues for any use of function pointers in C51; see http://www.8052.com/forum/read.phtml?id=47543 for some very important references that you must read before using function pointers in C51.
As Peter Dannegger subsequently poitns out, it is perfectly possible to do it in C51 - but you need to understand the issues if you're to avoid the pitfalls and some really weird bugs!


List of 4 messages in thread
TopicAuthorDate
Function pointer and call tree in Keil            01/01/70 00:00      
   RE: Function pointer and call tree in Keil            01/01/70 00:00      
      RE: Function pointer and call tree in Keil            01/01/70 00:00      
   RE: Function pointer and call tree in Keil            01/01/70 00:00      

Back to Subject List