This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to store data

Hi,
I am using keil C compiler using AT89S8252 as target device.
I am good at assembly but a beginer for C language.
Using C language, I need to know how do we store and retrive the data in code and eeprom area as we can do in assembly language for the look up tables like 'movc a,@dptr'
Thanks for the help.
-arun

Parents
  • You declare variables in the program store (code) memory by using the extension keyword code, e.g.

    U8 code someByte;

    I don't know what kind of EEPROM you have. If it's a parallel interface and the address decoding logic maps it into data store, you'd most likely want to declare the data xdata and const.

    U8 const xdata someEepromByte;

    As Andy says, the compiler manual has all the details. The data sheet for your particular part will describe how to access its built-in EEPROM (assuming it has one).

Reply
  • You declare variables in the program store (code) memory by using the extension keyword code, e.g.

    U8 code someByte;

    I don't know what kind of EEPROM you have. If it's a parallel interface and the address decoding logic maps it into data store, you'd most likely want to declare the data xdata and const.

    U8 const xdata someEepromByte;

    As Andy says, the compiler manual has all the details. The data sheet for your particular part will describe how to access its built-in EEPROM (assuming it has one).

Children
No data