> I'm getting the error again. The problem is with a big array, but it is
> declared as code, not data memory:
> 
> __code unsigned char cod3[]={

OK, as I just found out, this also ends up in a section called 
ID_filename_number, which is, however, declared as code rather than 
idata... So you are out of program memory (just under 8 kB) this time 
(assuming you observe "error: no target memory available for section 
"ID_filename_number", where filename.asm has cod3 allocated in 
ID_filename_number).
Are there more such huge arrays? Try compiling/assembling/linking with 
cod3[] (and possibly others) reduced to a few bytes and inspect the 
generated .map file (sdcc -Wl,-m or gplink -m) to find out about the 
memory usage. Maybe your code is larger than you hoped, or there are 
more program memory data structures pulled in from somewhere?

> The size of cod3[] is about 1kb.

That should be OK, program memory banks are 0x800 Bytes (2 kB), so none 
of your data structures may cross a 2 kB boundary or be larger than 2 
kB. Maybe the linker chooses suboptimal placement of your objects, 
resulting in fragmented program memory. Reordering your data objects in 
the files or the order in which the files are passed on to the linker 
could help in this case. But inspect the .map file first to see if there 
is any chance of placing your data!

Good luck,
Raphael

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to