Ive looked on the .map file and found that cod3 is about 2kb... The problem
is that

__code char cod3[]={0x1, 0x2, 0x3...

is translated in:

retlw 0x1
retlw 0x2
retlw 0x3

which occupies 2 bytes each. So, an array that has 1kb, actually has 2kb.
Its what i think.
Is there a way to do something like this?

__code char cod3[]={0x1, 0x2, 0x3...

cod3:
 0x1
 0x2
 0x3

Thanks.

On Sun, Sep 7, 2008 at 3:37 PM, Raphael Neider <[EMAIL PROTECTED]> wrote:

> > 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
>
-------------------------------------------------------------------------
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