Hello,
I have the following line of code which I need to store in the IDATA memory starting from 92H.
char code *text_to_compare = "Tesing";
How can I achieve this please?
I have the following line of code which I need to store in the IDATA memory starting from 92H. in C you do not want absolute addresses char idata *text_to_compare = "Tesing";
you may want to spell "testing" correctly
"I tried changing this code from a structure to a string but unfortunately it did not work."
And the question then is still if you wanted to move the pointer or the character array to a specific memory region. It really is important to understand the difference between:
char *str = "hello";
and:
char str[] = "hello";
Thanks for the reply. I need to move the character array starting from 92H.
Can you create a pointer and then assign the address of the pointer the memory location 92H.
Then just assign the character data one character at a time.
char * ptr;
ptr = 0x92;
*ptr = 'h'; ptr++;
*ptr = 'e'; ptr++;
*ptr = 'l'; ptr++;
*ptr = '0'; ptr++;
I think this should work.
Again, why this fixation with the absolute address?
Really, that's not the way to be thinking in 'C'!
www.catb.org/.../smart-questions.html
You would have to make sure that it's a specific IDATA pointer
http://www.keil.com/support/man/docs/c51/c51_le_memtypes.htm
http://www.keil.com/support/man/docs/c51/c51_le_ptrs.htm
View all questions in Keil forum