Hi, I am using Function to Pointer. i have definded this functin poiter in one structure with two long variable argument. it is giving me error below. Error C212: indirect call: parameters do not fit within registers. though it is given in c51.pdf that it will pass funciton argument with two long variable, i face this error. expecting solution as soon as possible code is like this typedef struct { unsigned long var1; unsigned long var2; void (*funptr) (unsigned long var1,unsigned long var2); }test; void main() { struct test *pt,t; t.vars1 = 6550; t.vars2 = 6551; t.funptr = TESTING; // where TESTING is fucntion definition macro pt->funptr(pt->var1,pt->var2); // here i get error listed above } thanks niraj
"I am using Function to Pointer" Due to the nature of the 8051 architecture, C51 has some limitations using function pointers. You need to read the following very carefully: http://www.keil.com/appnotes/docs/apnt_129.asp http://www.keil.com/support/docs/2066.htm http://www.keil.com/support/docs/210.htm http://www.keil.com/support/docs/806.htm