Global variables are also put in a different section, so the trick is:

#define ARRAY_1_LEN             60
unsigned char array1[ARRAY_1_LEN];          /* global (non-static) array */
#define ARRAY_2_LEN             60
static unsigned char array2[ARRAY_2_LEN];   /* local (static) array */

Borut


On 21. 01. 2012 16:36, Gál Zsolt wrote:
> Hello Tamas,
>
> It is not an intelligent solution for this problem, but you can make
> arrays initialized. The compiler put them initialized data section
> separately so the linker can allocate memory for them independently.
>
> Example:
>
> #define ARRAY_1_LEN             60
> static unsigned char array1[ARRAY_1_LEN] = { 0 };
>
> Zsolt

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to