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

Problem with global variable

Hi

I write a C program in uvision3. I have a global vriable "byte xdata *MemoryArea = (byte *)0x8000" and I define it in "flashdata.c". I have a function that use "MemoryArea". This function define in "mmngr.c". In this function there is a local variable "byte * tmp" and tmp = MemoryArea;
When I run this program tmp get value "X:0x0c84" ???
why??? I want tmp get value "X:0x8000". Whatis problem?

When "byte xdata *MemoryArea = (byte *)0x8000" is define in "mmngr.c" all thing is true and tmp get value "X:0x8000".

My Microcontroller is "Sle66c360pe"

Parents
  • ... "day job", "endless computer nights", "please answer me right now". These are definitely antagonic activities.

    Some of us must balance the heavy load of a few concurrent projects in our 'day jobs', the research that said 'day jobs' require in the 'home lab', and a few hours of forum thread follow-up in the meantime.

    "anisotropy of timezones" That is an interesting geographic effect indeed.

Reply
  • ... "day job", "endless computer nights", "please answer me right now". These are definitely antagonic activities.

    Some of us must balance the heavy load of a few concurrent projects in our 'day jobs', the research that said 'day jobs' require in the 'home lab', and a few hours of forum thread follow-up in the meantime.

    "anisotropy of timezones" That is an interesting geographic effect indeed.

Children
No data