Since the c51 compiler does not support the recursive call of a function is there any way to find out on which address location the function which is to be called as a recursive is located?
That is, is there any way to implement the recursive call funtion in a similar way of a software reset i.e just call like this ,
((void (code *) (void)) 0x0000) ();
The tools do support recursion. Just declare the function with the reentrant keyword. See the manual for configuring the software stack.
Note that there is signficant overhead for using this feature. The 8051 architecture is pretty bad at indirect references (such as those needed to use parameters/locaks on a stack) and the compiler doesn't get to do its nifty data overlaying optimizations.
The name of the function is the address of the start of the function. It's a pointer. I don't think that will really help you, though, unless the body of the function generated by the compiler understands that it can exist multiple times at once and so includes code to look on a stack for parameters, locals, etc.
I declared the functionas reentrant but then also i got the warning L13: Recursive call to segment.
I am not much familiar with the configuring of the software stack.
Can i know what are the things needed to taken care when doing a software stack adjustment and how it is done?
For the stack, you just need to make sure that you _have_ a stack. See the manual and STARTUP.A51 to configure it.
View all questions in Keil forum