Hi all, i dont know that much about keil, and i want to know wether we can use pointers in keil like in C? If yes then how?? Thanking you.
Yes, you can use pointers, just as per the ANSI spec. The C language specification makes the assumption that the CPU has only one address space. The 8051 has several different addresses spaces. In addition to the "generic" pointers that can point to any memory space, Keil C51 has extensions that allow you to declare memory-space-specific pointers that are more efficient than the "generic" pointers. Details are in the manual, as was mentioned above.
I have the various forms of pointers defined this way (examples)
// pointer in data in #define U8DI unsigned char idata * data // data idata #define U8DX unsigned char xdata * data // data xdata
"Keil C51 has extensions that allow you to declare memory-space-specific pointers" and also has extensions that allow you to specify which memory area is to be used by a variable definition. With pointers, you can use both of these extensions simulataneously: one to specify in which memory area the pointer value is stored, and another to specify in which memory area the "pointed-to" location lies! Yes, you guessed it: full details are in the Manual!