Hi, I need to read a memory location (SRAM)and load the value into a variable of type integer in my 'C' code. How do I achieve the above mentioned problem in C? Do I need to do some kind of translations to be done when I read the value so that it would be read as proper integer? Regards, Jinen Dedhia
"How do I achieve the above mentioned problem in C?"
#define SOME_ADDRESS 0x1234 int i = *(int*)SOME_ADDRESS;
You haven't stated what target you're using. For an 8051, remember that you will need to specify the appropriate memory space - DATA, XDATA, etc...
Thanks a ton people. I think I have got the solution. Regards, Jinen.