This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

code size with multiply/divide math

Other Parts Discussed in Thread: MSP430G2553, MSP430-IQMATHLIB

Dear all,

I am using msp430g2553 on launch pad. I need to do simple math on A/D date collected. When I compile the code 3-Ch A/D and and some data manipulation the code size is 400-500 bytes with CCS or IAR environment. 

When I multiply the data to get some results, the code size in CCS rises to 4k to 5kB and in IAR it is 1k to 1.5kB. I have not tried more complex calculations yet.  Why is that much difference in code size for CCS? the MUL routine in assembly does not seem to be too big..!

Is there a way to get smaller code size?

I will appreciate help, thanks,

IR 

  • Hi,

    Are you using floating point operations? If so, try to change them  to integer operations or use the fixed point lib:

    http://www.ti.com/tool/msp430-iqmathlib

    What optimization level are you using?

    Regards,

    Jose

  • Are you referring to integer or floating-point multiplication?

        -- Anders Lindgren, Author of the IAR compiler for MSP430

  • I know this is an older post but I just came across it.  One difference could be the preference settings for using hardware assist.  I know the in CCS, there is a preference setting to use the MPY block for multiply and divides.  If this is enabled, the code is much smaller and executes much quicker.  If this is disabled, the code is larger and execution much slower.  It could be that they are opposite values in the two compilers.

    Brent

**Attention** This is a public forum