We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hello everyone, i am writing program in 'c'
i have bcd to hex routine in which i am using 2 variable of unsigned int data type initialised to '0' and '1000' resp eg: unsigned int a=0;
program compiles well and downloads in chip of c8051f020
but when i debug, one of the variables contents remain unchanged
i checked the ram location where it is stored,ram location contents are not changed by statement
why this is happening,
data declared in the function is data i.e stored in genereal purpose ram
in c memory, register are all taken care by compiler but my locations are affecting
i have bcd to hex routine in one '.c' file and calling is in another '.c' file
is it creating a problem? but i have many such files and they are not affecting
even i checked stack also but nothing i could make out
thanx to all take care
"[...] stored,ram location contents are not changed by statement"
Your code basically looks like (after stripping away meaningless code that does not give any side effects):
unsigned int Bcd4toHex4(unsigned int a) { return 0; }
So, why should the compiler change any contents of any memory area? You must _do_ something in your function, to get the compiler to bother to generate any code.