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.

Help need with conditional assembling few lines of assembly code on TMS320vc5470 using ccs 3.3



#ifdef APP

some code

#else

some other code

#endif

i have tried

 Example:
     ------------------------------------------------------------
                                                       myheader.h

        #define WANT_ID 1
        #define NAME "John\n"

        extern int a_variable;
        extern float cvt_integer(int src);

        struct myCstruct { int member_a; float member_b; };

        enum status_enum { OK = 1, FAILED = 256, RUNNING = 0 };
 
     ------------------------------------------------------------
                                                        myasm.asm
              .cdecls C,LIST,"myheader.h"

     size:    .int $sizeof(myCstruct)
     aoffset: .int myCstruct.member_a
     boffset: .int myCstruct.member_b

     okvalue: .int status_enum.OK
     failval: .int status_enum.FAILED

              .if $defined(WANT_ID)
     id       .cstring NAME
              .endif

 but i am getting error mentioning

[E0004] Absolute, well-defined
        integer value expected

if someone can share small code snippet how to assembly different lines of assembly code based on a macro, it would be of great help.

 

Regards,

Avinash

  • Avinash,

    Your question doesn't seem to be specific to BIOS, so I have moved this thread to a different forum in hopes that you'll get a faster response there.

    Dave

  • Your test case works fine for me, assuming I have correctly extracted it from your forum post.  Please pack your example including myheader.h and myasm.asm into a ZIP file and attach that to the post.  Exactly what line does the error message appear on?  What version of the compiler are you using (this is not the same as the CCS version).