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.

What are the calling conventions supported by CCS

 I am using CC V 6.0 IDE. I have ported IAR code to CCS.(MSP430F24xx)

The code builds fine with CCS after compiler specific changes.

But during execution it is not working properly..

One reason i can think is calling convention.

I want to know what are the thing to be taken care in code to work as expected at run time and what are the calling convention CCS support and whether it is possible to change it in the IDE?

I am already refering below documents for IAR to CCS convertion..

http://www.ti.com/lit/ug/slau157af/slau157af.pdf CCS Users Guide

http://www.ti.com/lit/ug/slau132j/slau132j.pdf 

As per the document one more thing to take care is below

====================================================

/* IAR, global variable, initialized to 0 upon program start */
int Counter;
However, the TI CCS compiler does not pre-initialize these variables; therefore, it is up to the application to fulfill this requirement:
/* CCS, global variable, manually zero-initialized */
int Counter = 0;

/* IAR, global variable, initialized to 0 upon program start */
int Counter;
However, the TI CCS compiler does not pre-initialize these variables; therefore, it is up to the application to fulfill this requirement:
/* CCS, global variable, manually zero-initialized */
int Counter = 0;

=====================================================

But i doubt do i really need to do this explicitly in CCS?

Thanks in Advance.

  • vinoth s1 said:
    But i doubt do i really need to do this explicitly in CCS?

    It depends upon which ABI is used for the project. With the COFF ABI the compiler itself makes no provision for initializing to 0 otherwise uninitialized static storage class variables at run time. It is up to your application to fulfill this requirement.

    With the ELF ABI the uninitialized variables are zero initialized automatically.

    See sections 5.15 Initializing Static and Global Variables in COFF ABI Mode and 5.11.19 The NOINIT and PERSISTENT Pragmas in the MSP430 Optimizing C/C++ Compiler v 4.4 User's Guide SLAU132J for more information.