Ernst Bachmann wrote:
> On Mittwoch, 18. Juli 2007, [EMAIL PROTECTED] wrote:
> 
>> I have a problem where i couldnt find a clear answer in the manual/list.
>> I want to initialize an 4x4 array like:
>>
>> char state_table[4][4]={{0,1,-1,0},{-1,0,0,1},{1,0,0,-1},{0,-1,1,0}};
>> but this only works if i add the code keyword infront of it. If code is
>> omitted the array does not work.
>> Is this the intended behavior? or am i doing something wrong?
>>
>> sdcc -v:  SDCC : pic16 2.6.4 #4631 (Feb 13 2007) (UNIX)
>> device: pic18f2550
> 
> Well, that pic should have enough ram for the array, but:
> 
> if the Array is in RAM, the startup code has to initialize it by copying the 
> values from Flash.
> That is usually done by the initialization code in crt0iz.o, which should be 
> linked automatically. 
> There are however also other versions of that init code available (crt0i.o, 
> crt0.o) which skip the variable initialization in order to save code space.

yes crt0.z was used in my Makefile since i had some startup problem for
the USB Code with crt0i(z) while ago. It seems all to rune fine now with
crt0iz.
So what/where is the prefered location for putting arrays/structs
1. without any option?
2. with the code option?
3. or with the #pragma udata ... option?


thx allot for your effort.
jan



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to