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.

Problems with mixed C/Assembler

 

Hello!

I have a CCS4 project and would like to set/reset XF by using inline assembly. So I put in the code:

 

asm(" bset XF");

and

asm(" bclr XF");

 

When compiling I get this error message:

ERROR!   at line 186:
 [E0000]
         parse error
     bset XF
    ^      

 

Furthermore I have another Assembler problem. When adding for example the file add.asm from DSP lib to the project and compiling this file I get the message:

C:\Programme\Texas Instruments\ccsv4\utils\gmake\gmake add.obj
'Building file: ../add.asm'
'Invoking: Compiler'
"C:/Programme/Texas Instruments/ccsv4/tools/compiler/c5500/bin/cl55" -v5505 -g --define="_DEBUG" --include_path="C:/Programme/Texas Instruments/ccsv4/tools/compiler/c5500/include" --include_path="D:/Eigene Dateien/WsPHFFT/inc" --include_path="D:/Eigene Dateien/WsPHFFT/PHFFT/Debug" --include_path="C:/Programme/Texas Instruments/bios_5_41_02_14/packages/ti/bios/include" --include_path="C:/Programme/Texas Instruments/bios_5_41_02_14/packages/ti/rtdx/include/c5500" --diag_warning=225 --large_memory_model --algebraic --asm_source=mnemonic --asm_extension=.asm --preproc_with_compile --preproc_dependency="add.pp"  "../add.asm"
ERROR!  : Cannot open source file 16: No such file or directory

This file IS present and when setting the assembly language to algebraic (which is of course wrong) the file gets assembled and I see a lot of error messages due to the wrong assembly language.

 

Any Ideas?

Thanks in advance,

 

Kai

  • Hi Kai,

    this problem is caused by the difference between algebraic and mnemonic assembly. What you use for setting your XF flag is "mnemonic assembly". For your compiler to understand this, you need to set some properties. Right-click on your file, which contains your assembly instructions, say main.c. Then select Properties -> C/C++-Build -> Runtime Model Options. Make sure that "Codegen outputs algebraic assembly" is not checked. Also, select under "Select assembly source language" the option mnemonic.

    This is also causing the problem with add.asm. From the compiler output, the "--algebraic"-option is selected. Make sure that this does not occur (i.e. uncheck "Codegen outputs algebraic assembly").

     

    One remark: The add.asm routine is buggy. Refer to the newest posts in this forum discussion if you observe wrong results:

    http://e2e.ti.com/support/dsp/tms320c5000_power-efficient_dsps/f/109/p/37568/131208.aspx#131208

    Wrong results will happen if the circular addressing mode for axiliary register AR0 was used before add.asm is called. This happens e.g. if fir.asm was called before add.asm was called. I already reported the bug, but given the fact that the latest release of the DSPlib is from 2007, I think it may take some to see an official fix.

     

     

    Let me know if that helped you and regards,

    Michael

  • I use examples from ccv4 and latest csl Examples for ccv4.0. I use one of the examples such as CSL_GPT

    make sure it builds and runs , make a copy in a new source .c file and paste to the new file. Then exclude the old file from

    building, modify the code. Never been successfll in starting from scratch.

    use the following to toggle XF,  (ledstatus == 1) asm(" BIT (ST1, #ST1_XF) = #0");

    this does not solve it isr reset of XF.

    Martin

  • Thanks a lot Michael,

    The problem is now solved. The main problem was that "Codegen outputs algebraic assembly" was checked.

    @Martin:
    I had the same problems so I also used an example as template for my own project.

    Best regards,

    Kai