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.

including the example .h files in asm files

Other Parts Discussed in Thread: CONTROLSUITE

Hello

I included the "DSP2803x_Device.h" into a .asm file (statement:  .cdecls "DSP2803x_Device.h")

It throws several assembly errors for the typedef given in the .h file for the basic datatypes like in,long, float,...

I tried adding the following kind of lines for all datatypes, but still no success.

.asg "int", int16

Any suggestion how to include those example given .h files into a .asm file?

 

Thanks,

 

Sayee

  • Hi,

    please look into generated assembler listing, there should be more information.
    You should find there also how the header is transformed to asm.

    Regards,
    PIotr Romaniuk, Ph.D.
    ELESOFTROM

  • PIotr 

    It is just about fixing the compile errors. As such, these example .h files are the foundation on which the customer can add extension to quickly implement their own application specific features, It is also imperative that a mixed language (read as C and assembly) programming would only be the possible way for building any worthy solution.

    For reasons of compatibility (while moving to other series within TI's DSPs) and upgrade (from current version of TI examples is 1.24), I do not want to come out with my own home brew of header files redefining all the header to make them assembly compatible and that will cause potential future problems..

    TI's approach is about seamless sharing of headers (across C and assembly) as stated in the assembler tools guide (spruge513?) and my question is for the tools (compiler/assembler team of TI) team. They should provide assembler preprocessor constructs to handle at least their own headers.

    I hope you understand and appreciate.

     

    Thanks

     Sayee

  • Hi,

    I agree that the headers provided by chip vendor should be errorless and work for both C and ASM.
    Unfortunately, sometimes it is not true and engineers need to handle that on their own.
    I am writing about better problem insulation, analysis and work-arounds. The problem analysis has an extra advantage,
    someone can understand that the source is interpretted in another way that he thought.

    The alternative is to wait for the vendor response and a fix if it is an error.

    Unfortunately, the header source is not processed by regular C preprocessor, but compiled to assembler.
    Because of that common contents for ASM and C is very limited.
    I spend a lot of time on writing a common header in my application, just to satisfy ASM inclusion.
    It is a weak point of TI tools.

    Regards,
    Piotr Romaniuk, Ph.D.
    ELESOFTROM

     

     

     

  • Mokan Kanna said:

    Hello

    I included the "DSP2803x_Device.h" into a .asm file (statement:  .cdecls "DSP2803x_Device.h")

    It throws several assembly errors for the typedef given in the .h file for the basic datatypes like in,long, float,...

    I tried adding the following kind of lines for all datatypes, but still no success.

     

    .asg "int", int16

    Any suggestion how to include those example given .h files into a .asm file?

     

    Thanks,

     

    Sayee

    Please try the following syntax in the assembly file:


          .cdecls   C,LIST,"file.h"

    An example can be found in the CLA examples in the device support for the 2803x in www.ti.com/controlSUITE. 

    In these examples we share a file called CLAShared.h


          .cdecls   C,LIST,"CLAShared.h"

    CLAShared.h also includes the peripheral bitfield header files via  DSP2803x_Device.h

    Regards

    Lori