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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/04/07 05:49
Modified:
  11/04/07 06:11

Read: times


 
Msg Score: +1
 +1 Good Answer/Helpful
#146565 - The table and function pointer
Responding to: ???'s previous message
After that, there would be a DATA segment too large C249 error in the CRC lookup table and what appears to be the receive buffer.

Assign the CRC table to the code space, using "code" memory specifier.

Then it has trouble with the function pointers struggling with trying to put function parameters on the stack (or the lack of one, I should say).

The function pointer causes problem because KEIL fails to makeup right call tree. Then, KEIL fails to overlay RAM for the parameters and working RAM of the functions.

It's too difficult for the current level of compilers, to interpret how the source code works, instead of how the source code is written.

When you provide proper linker directive to correct the call tree, no need to rewrite the code for the function pointer.
See this KEIL KB article.

"C51: PROBLEMS WITH FUNCTION POINTERS OVERWRITING VARIABLES"
http://www.keil.com/support/docs/210.htm

Tsuneo

List of 8 messages in thread
TopicAuthorDate
Porting FreeModbus            01/01/70 00:00      
   they are not            01/01/70 00:00      
   Is this even feasible            01/01/70 00:00      
      compiler warnings            01/01/70 00:00      
         The table and function pointer            01/01/70 00:00      
            More on function pointers in Keil C51            01/01/70 00:00      
      more porting to do            01/01/70 00:00      
         You mean linker            01/01/70 00:00      

Back to Subject List