Hi Fellas,
Please help me out in the problem that, I am passing a 3D array as function argument. But instead of referencing to same location of 3D array keil microvision4.02 makes another copy to some other location and now it is duplicating the array and occupying double size in xdata memory (in which i have decalared/defined the 3D array) . At the end , I am exceeding the size of avaiable 32K memory and my program is not compiled properly.
If somwhow I be able to stop this array duplicating and save the array doubling, then I can get rid of my problem. I am using keil micorvision 4.02,TI MSC1210Y5 controller with 32k flash.
Please suggest me.
Regards
Nothing specific to Keil or embedded development except for the xdata declaration. You have similar requirements for all C compilers, i.e. that you must understand the difference between definition and declaration.
The "extern" line just tells that there is a "3 Abbey Road" (somewhere).
The line without "extern" is the physical "3 Abbey Road".
In fact, similar requirements for all programming languages that allow you to construct a "program" from multiple "components"!
In some languages, you have to explicitly "export" things that are to be available to other "components"; eg, using a keyword like "Public" - this makes it clear that anything referenced as "Extern" has to have a corresponding "Public".
In 'C', there is no "Public" keyword: things at file scope are implicitly public - unless specifically made non-public with the static keyword.
Again, this is all standard textbook stuff - nothing specifically to do with embedded or Keil.
For some essential basic reference materials, see: blog.antronics.co.uk/.../12
For a specific aritcle on declaring and defining global variables and functions (including the difference between declarations and definitions), see: c-faq.com/.../decldef.html