Hi,

>> Sdcc generates a startup function to initialize data in ram. (copy values 
>> from rom to ram)
>> This feature should be able to switch off when it is not necessary. It could 
>> be useful for low
>> memory microcontrollers.

For now, you can include

void _sdcc_gsinit_startup(void)
{
  __asm pagesel _main __endasm;
  __asm goto _main __endasm;
}

into your project sources and thus prevent the linker from including
sdcc's library implementation of globals and statics initialization.
If you add the function to the file that also contains your main(),
you can even leave out the pagesel, which shortens the function code
further from 6 to 2 bytes (3 => 1 instruction).
Adding a command line option (say "sdcc --no-gsinit-startup") could
save additional 2 bytes and would be more convenient ...

Raphael

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to