Hi Vaclav,
I have one application - some special type of headlamp driven by PIC12F675. The problem is that I can not fit into the memory.
[snip]
I use all functions static. Most of them is used on more places, so inlining is not the right way. My variables are as short as possible. But there is a lot of banksels near variables. Can I optimize banksels somehow ? I could not find any SDCC flag for PIC14 port.
As far as I know, there is no such flag for the PIC14 port. BANKSEL optimizations appear to be enabled unconditionally.
Is there any other way how to reduce the overhead code ? Probably something in libsdcc.lib and pic12f675.lib ?
You can try to avoid pulling in about 200 bytes of code from idata.c (libsdcc.lib) that initializes your global/static variables. If you are sure not to require that functionality (e.g., because you set up your globals in main and do not use static variables), you can define
void
_sdcc_gsinit_startup(void) {
__asm pagesel _main __endasm;
__asm goto _main __endasm;
}
void
main(void)
{
/* your code */
while (1);
}
see attached sample blinky14.c
The pic12f675 only defines the SFR locations (linker symbols) and
contributes no code at all.
Good luck, Raphael
blinky14.c
Description: Binary data
------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H
_______________________________________________ Sdcc-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sdcc-user
