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.

Error in compiling Assembly code in CCE V3

Other Parts Discussed in Thread: MSP430F4793

Hello friends,

I am currently using MSP430F4793 microcontroller with CCE V0.3

I have write some code in assembly language. But when i compile code it gives error E0002 and E0300.

I have written below code. I didn't understand what is wrong in code. When i comment PUSH instruction error disappears.

asm("PUSH R10\n"
        "PUSH R11\n"
        "PUSH R12\n"
        "PUSH R13\n"
        "PUSH R14\n"
        "PUSH R15\n" 
        " MOV bb,R10\n"
        " MOV aa,R11\n"
        " MOV #32,R15\n"
        " CLR R14\n"
        " CLR R13\n"
        "LABC: RLA R11\n"
        " RLC R10\n"
        " DADD R13,R13\n"
        " DADD R14,R14\n" 
        " DEC R15\n"
        " JNZ LABC\n"
        " MOV.b R14,bcd+2\n"
        " SWPB R14\n"
        " MOV.b R14,bcd+1\n" 
        " MOV.b R13,bcd+4\n"
        " SWPB R13\n"
        " MOV.b R13,bcd+3\n" 
        " POP R15 \n"     
        " POP R14 \n"
        " POP R13 \n"
        " POP R12 \n"
        " POP R11 \n"
        " POP R10 \n"
          );

 

Please reply me regarding this error.

  • The TI assembler interprets any text beginning in the first column of text as a label, (ie) the instruction cannot appear in the first column. Putting a space or a tab before the text tells the assembler to parse the text as an instruction instead. This is documented in the MSP430 Assembly Language Tools Users Guide, Pg 42. To fix your errors, just add a space before the PUSH instructions similar to what you have for the MOV and other instructions.