• Resolved

Compiler/TMS320F28035: Compiler question about __asm("") directive under C environment

Part Number: TMS320F28035

Tool/software: TI C/C++ Compiler

Hi everyone, 

I'm a newbie for TMS320F28035. Recently, I'm using cla with C language (CCS 5.5.0) and for some reason I need to use assembly language.

I use the __asm("") to implement the assembly. But I found that when compilation is finished, there will have two additional directives in the cla_task.asm file.

It shown as below. There are additional two MNOP directives at top and bottom. How can I avoid this happen? 

Thanks for help

  • Please see the section titled The __asm Statement in the C28x compiler manual.  Closely read the NOTE paragraphs.  You should not use __asm statements to load values into registers used by the compiler.  That disrupts the code generated by the compiler.  

    Instead, you should code this entire function in assembly language, and call it from C.  For help with that, please see the section titled Interfacing C and C++ With Assembly Language.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click Verify Answer on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Dear George:

    Thank for your suggestions. I have ever tried call function method but I failed.
    I will try call function method again.

    Thank for help again.

    Best regard,

    Brian
  • In reply to Brian:

    Please see if the wiki article section titled Accessing Assembly from C Questions is helpful.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click Verify Answer on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Dear George:

    Thank for your kindly help!

    I'm finishing the function and it's working now.

    Best regard,

    Brian