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.

CCS/MSP430FR2311: Is there a method for checking the assembler version in CCS like in IAR using __VER__ ?

Part Number: MSP430FR2311

Tool/software: Code Composer Studio

In the past we used IAR for our projects. Currently we are using CCS V9. We've checked the assembler version in our source code using the  __VER__ variable and generated an error if a different assembler was used to re-assemble the code. Is there a way to do so in CCS?

Thanks

  • There is no predefined symbol similar  to __VER__.  However, here is a workaround for you to consider ...

    ; file.asm
    
            .cdecls LIST
            %{
                 #define ASM_VERSION __TI_COMPILER_VERSION__
            %}
    
            .data
    symbol:
            .long   ASM_VERSION

    Line 3 uses the .cdecls directive.  Search for that in the MSP430 assembly tools manual.  It is being used in an unusual way here.  The LIST parameter says to show the details of what is being defined in the listing file.  Lines 4-6 are an escape into C code.  The compiler predefines a preprocessor symbol named __TI_COMPILER_VERSION__.  Please search for that in the MSP430 compiler manual.  It is a representation of the compiler version in the form of a large decimal number.  The assembler version matches the compiler version.  The remaining lines are a contrived use of ASM_VERSION.  

    To get an idea of how this works, build with a command similar to ...

    % cl430 -al file.asm

    ... then inspect the resulting file.lst.

    Thanks and regards,

    -George