problem in writing C program

Discussion in 'Programmer's Corner' started by cktcrazy, May 15, 2011.

  1. cktcrazy

    Thread Starter New Member

    Mar 27, 2011
    16
    0
    hello

    i ve a problem writing program in C. Previously i used assembly program now i'm switching to C .

    In assembly we are assigning an inbuilt eeprom memory by writing

    FOR EX.

    position DATA 0008h

    where position is any variable

    we are assigning eeprom memory address 00008h to any user defined variable ,here taken as 'position'

    thereafter we are accessing value from this memory address by using the
    movx instruction and dptr .

    but in C how we can define this eeprom address as well as how we can access value stored in this memory address ???

    plz help me in this regard

    thank u
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    It would help if you could tell us which C compiler and MCU you use ;)
     
  3. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    This is a microcontroller compiler specific feature and every compiler has its own way of addressing eeprom. Since we have no idea which compiler or even which microcontroller you are using about all we can advise is "read your compiler manual".
     
  4. cktcrazy

    Thread Starter New Member

    Mar 27, 2011
    16
    0
    hi
    i am using the C51 compiler the IDE i'm using is the uvision 2

    and 8051 architecture mcu

    plz have a reply

    thank you
     
  5. cktcrazy

    Thread Starter New Member

    Mar 27, 2011
    16
    0

    hi
    i am using the C51 compiler the IDE i'm using is the uvision 2

    and 8051 architecture mcu

    plz have a reply

    thank you
     
  6. cktcrazy

    Thread Starter New Member

    Mar 27, 2011
    16
    0
    hi
    i am using the C51 compiler the IDE i'm using is the uvision 2

    and 8051 architecture mcu

    plz have a reply

    thank you
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Sorry I do not know the CPU or the compiler. But is is amazing what you can find with Google. Try something like C51 compiler eeprom.
    Good luck
     
    cktcrazy likes this.
  8. nigelwright7557

    Senior Member

    May 10, 2008
    487
    71
    I havent used it in many years but I think you need to use the & operator which means address of. But I could be wrong.
     
Loading...