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
I am able to read the memory location into one of the internal registers using assembly language. What I want to do is, I need to assign this register's value to one of the variables in 'C'. How do I do this?
"How do I achieve the above mentioned problem in C?"
#define SOME_ADDRESS 0x1234 int i = *(int*)SOME_ADDRESS;
fundamental C read a C book Erik
What I want to do is, I need to assign this register's value to one of the variables in 'C'. C does not "know" anything about registers, everything is just variables. If your post is a convoluted way to ask about assmbler interface to C, state so. If by 'register' you mean a SFR, state so If by 'register' you mean a variable, state so Erik
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.