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.

About DM6437 Assembler?

Hi every body :

Can I asking some question about how to compiler pass the assembler? When I use the CCS 3.3 compiler assembler I already fail. DO I notice setting about the Build option. If every body have the user guide can teach me how to compiler the assembler I will be very grateful.

thanks~~

best regards

  • I am not sure I understand your question or what you are trying to do. Are you trying to build in some hand written assembly, or are you asking about inline assembly with the compiler?

    In either case I imagine you are getting some sort of build errors, could you post your build output for some analysis?

  • Hi all :

    I have two case . The first case is : I want to write assembler between the C code. Just like this :

    I put the NOP 3 to try compiler can pass or not . But fail. The error message is : "video_preview.asm", ERROR!   at line 624: [E0002] Illegal mnemonic specified       NOP 3

    I try to set up the build option setting. But I'm not sure my setting is right. 
                                                                     

     void trans_frame(unsigned char fin_buf[], unsigned char fou_buf[])    
    {
     unsigned char min_buf[16];
     unsigned char mou_buf[16];
     int i,j, k, l;
     asm("NOP 3");
     for(i=0; i<54;i++)  // frame buffer size 38016/(176*4) = 54
     {
      for (j=0; j<44;j++)  // 176 / 4 = 44 ==> 1 matrix 16 bytes
      {
       for (k=0; k<4; k++)
       {
        for (l=0; l<4; l++)
        {
         min_buf[k*4+l] = fin_buf[i*704+j*4+k*176+l];
        }
       }
       trans_4x4(min_buf, mou_buf);
       for (k=0; k<4; k++)
       {
        for (l=0; l<4; l++)
        {
         fou_buf[i*704+j*4+k*176+l] = mou_buf[k*4+l];
        }
       }
      }
     }
    }

    The second case is

    I build a new project. And new asm file. The asm code is :

    In this project I didn't  build the cmd file. The error message is :  "asm_test1.a", line 1: error: expected a declaration

                                                                            The message warring is:  At end of source: warning: parsing restarts here after previous syntax error

                        .sect ".test"
                        .global myfunc
    myfunc:      .asmfunc
                        STW  .D2T2 B3,*B15
                        MVKL  .S2  RL0,B3
      
                        RL0: LDW  .D2T2 *++B15(16),B3
                        ZERO .D1  A4
                        NOP    3
                        RET  .S2  B3
                        NOP    5
                        .endasmfunc

    best regards

     

  • Jerry Yu said:
    I put the NOP 3 to try compiler can pass or not . But fail. The error message is : "video_preview.asm", ERROR!   at line 624: [E0002] Illegal mnemonic specified       NOP 3

    In this case I believe your problem is a missing space, your asm call should look like asm(" NOP 3"); with a space before the NOP, otherwise the assembler will try to treat it like a label and not an instruction.

    Jerry Yu said:
    In this project I didn't  build the cmd file. The error message is :  "asm_test1.a", line 1: error: expected a declaration

    The first thing that pops out to me here is the file having a .a extension and not a .asm or .sa extension which may be causing the compiler to not treat it as a proper assembly file. I don't do much with pure assembly files as most folks seem to use optimized C these days though so I am not sure if that is ok or not.

  • Hi all :

    thanks for your help~ I try two case problem but I still have some problem.

    The first problem is :

    You tell me case two error is the file name must use .a and don't use .asm. But in this project I already use asm_test1.a. So I feel very strange.

    The second problem is :

       In your describtion, I know much pepole optimize code using C. Can you give me some suggestion about optimized C code. In our lab, we already use the CCS optimized function(about build option section) but the code still no efficiency. Therefore our advisor tell me must to write the asm. I hope you can tell me some suggestion.

    thanks for your help~~

    best regards