We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using Cygnal controller C8051F005 which has on chip external 2K memory. I defined one array as follows. xdata char mydata[1440]_at_0x97; In mydata array I am storing my data. But I observe that some initial part of the array is getting currupted. I am unable to know, how it gets currupted. Please let me know when I declare an array as mentioed above, does the compiler use the memory reserved for above array. If yes, then how should I solve this problem.
Why do you need the _at_ 0x97?
Because I have used memory location f000 To 00097 for other purpose.
In my above reply Please read the address as 0000 to 0097
does the compiler use the memory reserved for above array. Have you looked in the MAP file? This kind of information may be found there. You may wish to refer to the linker manual for a description of the MAP file sections: http://www.keil.com/support/man/docs/lx51/lx51_ln_mapfile.htm Jon
Yes the compiler use the memory reserved for above array. Please let me know this action of compiler is legal.
"Because I have used memory location f000 To 00097 for other purpose." In that case, you should specify the available XDATA address range in the Target options. After all, that's what you really want: you don't really need to fix the address; you just need to prevent the Linker from using it! Might it help if you told us why this area has to be reserved?
Yes the compiler use the memory reserved for above array. Please let me know this action of compiler is legal. I am positive it is "legal". Reading the manual will tell you why the particular configuration you have chosen (e.g. small/compact/large or reentrant or whatever) lead the compiler to do so. Erik
I have chosen large memory model. If you say it is legal, then how I can reserve particual memory area for particular array? so that the compiler will not desturb the array contents.
Don't interfere with the operation of the tools! If you need to exclude a certain address range, see the Linker Manual. Or specify the available range as I suggested earlier. Why do you need to do this anyway?