Hello, I would like to know how the keil compiler locate the arguments of a function. 1) it pass it via the stack? 2) it declares a places in the memory space, and in this case how he choose the memory space that it will use? Thank You Kaoru
I have 4 function of the type void funct(unsigned char) three of them are not optimized and the compiler put the parameters in the external memory. And only one of them is optimized by passing parameter in the register. For the three first functions, at the compilation, it will change the place of the parameter. Am i correct? Is there a mean to locate the parameter somewhere in the xdata? As those four functions are a part of a same level. i want them to be similar in the way of passing parameters. Like this i will have the same technology use for a same level. Do you think it is possible to do that by passing parameters in those functions? thank you Kaoru
Are some of them "leaf" functions, and some not?
Use NOREGPARMS and the compiler puts ALL ARGUMENTS IN MEMORY and NONE IN REGISTERS. Jon
I am sorry I don't understand what is "leaf"... The only difference between the function is the moment that i use the parameter. In the function that is compiled by passing parameter in the register, the variable is used just after the declarations. But for the other the variable is used in the middle of the function. the NOREGPARAMS is a good idea but as i want that the compilation is always the same, i have to locate those arguments. Can you tell me if it is possible? I tried to do it without success. Thank you Kaoru
i have to locate those arguments. Can you tell me if it is possible? If I understand you, you want to locate the arguments to several functions to the same address. For example:
int func_a (int arg_a, int arg_b, int arg_c); int func_b (int arg_a, int arg_b, int arg_c); int func_c (int arg_a, int arg_b, int arg_c);
int arg_a, arg_b, arg_c; int func_a (void); int func_b (void); int func_c (void);