CodeVision has a lot of nice features, among them the automatic generation of the interrupt vector.
However, now I'm working on a very small bootloader, and I can't afford any interrupts. CodeVision still happily generates the interrupt vector at the beginning of the Flash memory, and I couldn't find a way to turn it off.
It is crucial, as the interrupt vector would take up 25% of the space in the flash memory for the smallest bootloader. (128 words bootloader, and the interrupt vector needs 32 words for a 16k atmega)
I set "Use an external startup initialization file" and I use my own startup.asm. Even if I don't include anything about the interrupt vectors, they are still generated for the executable.
2 Answers 2
Generally to remove whole section like that you will need to use a custom linker script and you may need to modify or remove some of the behind-the-scenes startup code that compilers usually throw in. Although for a 128 word bootloader, you may be better served writing it in assembly.
-
\$\begingroup\$ I know. This has been discussed in the comments. The question is, how exactly to do it as I couldn't find a way for it in the mentioned compiler. And if I write it all in Assembly I still have to compile it to machine code. \$\endgroup\$vsz– vsz2013年10月29日 07:10:24 +00:00Commented Oct 29, 2013 at 7:10
The CodeVision Advanced (costing 50 € more than the standard version) has an option for it in the Project|Configure|C Compiler|Advanced menu.
void main(){}
still does generate the interrupt vectors. In the project configuration I couldn't find anything relevant, and I hunted on Google for possible#pragma
settings, without luck so far. \$\endgroup\$