Compilation error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Compilation error

439 Views
Nagarjuna
Contributor I

Hi,

 

I am trying to compile a GCC project using codewarrior HCS12 compiler.

 

I am getting a compiler error C12070 Identifier expected at the below line for asm function.

 

"m" (*((unsigned int *)&log_tooth+1)), \

 

I am pasting the asm function code as below.

 

__asm{           
                 ldab  (__arg1);
                andb  #0xf;
                 brclr (__arg3),#1, tlnot_sync;  // #0x01 is SYNC_SYNCED -> 0x10 in log top byte
                orab  #0x10;
                tlnot_sync:
                brclr (__arg3), #8, tlnot_semi; // #0x08 is SYNC_SEMI -> 0x40 in log top byte
                orab  #0x40;
                tlnot_semi:
                brclr (__arg3), #0x10, tlnot_semi2; // #0x10 is SYNC_SEMI2 -> 0x80 in log top byte
                orab  #0x80;
                tlnot_semi2:
                brclr (__arg4),#1,tlnot_trg2; // #0x01 is flagbyte1_trig2active -> 0x20 in log top byte
                orab  #0x20;
                tlnot_trg2:
                stab  0,Y;

                ldd  (__arg2);
                std  1,Y;\
                : \
                : "y" (log_offset+ram_data),  \
            "m" (*((unsigned char *)&log_tooth+1)), \  // byte 3:**2**:1:0
            "m" (*((unsigned int *)&log_tooth+1)), \ // bytes 3:2:**1**:**0**
            "m" (synch),  \
            "m" (flagbyte1) ;
        }

 

Could you please help me in solving this compiler error.

 

Kindly let me know if there are any bacis hints to take care while porting a GCC project to codewarrior.

 

Regards,

Nagarjuna

Labels (1)
0 Kudos
1 Reply

346 Views
NavidadRedivivu
Contributor III

Well, the thing is that the s12 compiler does not support gcc-style inline assembly. This is likely to become an issue if your project contains a lot of inline assembly. If it doesn''t, it should be fairly easy to port. Keep in mind that the general format of a GCC-style inline assembly statement is __asm { list_of_assembly_statement :  ist_of_output_operands : list_of_input_operands: list_of_clobbered_registers}. That is if memory serves. Use your best judgement afterwards. I can't provide you a compilable solution at this time, maybe it would help if a) you provide a larger snippet of code and b) provide the types of all the required variables (e.g. log_tooth).

0 Kudos