Use these hints to reduce the size of your application:
- Verify that you need the full startup code:
- If you have no initialized data, you can ignore or remove the copy-down
- If you do not need initialized memory, you can remove the zero-out.
- If you do not need either, completely remove the startup code and set up your stack directly in the main routine. Use INITmain in the prm file as the startup or entry into your main application routine.
- Check the compiler options:
- Find out if you can use IEEE32 for both float and double. (See -T: Flexible Type Management for configuration. Remember to link the corresponding ANSI-C library.)
- Use smaller data types whenever possible (for example, 16 bits instead of 32 bits).
- Check runtime routines in the map file (runtime routines usually have a _ prefix).
- Check for 32-bit integral routines (for example, _LADD).
- Check if you need the long arithmetic.
- Check the size of enumerations. enums have the size int by default. If possible, set enums to an unsigned 8-bit (see option -T, or use -TE1uE).
- Find out if you are using switch tables (look in the map file as well). Configure switch table use speed or code density (see -CswMinSLB: Minimum Number of Labels for Switch Search Tables).
- Use the linker to overlap ROM areas when reasonable (see the -COCC option).