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.

CCS/MSP430G2553: Assembly

Part Number: MSP430G2553


Tool/software: Code Composer Studio

Hello! Could you please help me?

I can't get what does this code do?

I've tried to run it in Code Composer Studio but nothing is declared and there can be bugs.

I just need to know the purpose of this code. I've just started learning microcontroller programming.

CLR.W   &var1  

CMP.W   &var2, &var1  

JHS   (L4)  

L1:

CLR.W   &var3  

CMP.W   &var5, &var3  

JHS   (L3)  

L2:

MOV.W   &var1, R12  

MOV.W   #0x000a, R13  

CALL   #multiply   ;   R13 * R12 -> R12  

ADD.W   #0x0200, R12  

MOV.W   &var3, R15  

RLA.W   R15  

ADD.W   R15, R12  

CMP.W   @R12, &var4  

JEQ   (L4)  

INC.W   &var3  

CMP.W   &var5, &var3  

JLO   (L2)  

L3:

INC.W   &var1  

CMP.W   &var2, &var1  

JLO   (L1)  

L4:

MOV.W   &var1, &var6  

MOV.W   &var3, &var7