#include<reg51.h> void fun(char,int,long); main() { step 1 fun(0xdd,0xaabb,0xfedcba); } step 2 void fun(char cc,int ii,long ll) { int i=0xabcd; char c=0x77; long l=0xabcdef; while(1); return; }
Thanks for the reply. But my dought is dat why are there 2 copies of the int and char data on the memory??? once at 0x04 and 0x05[r4 and r5] for int, at 0x07[r7] for char. That happens when the calling function line in the program is exectued. but in the next step again the char and int data at locations 0x08, 0x09 and 0x0A are present. Y is it?
Your code shows that fun()'s parameters are not being used initially. Those parameters need to be stored so that the auto's can be allocated to the registers for operation.
Thank You.