This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Need help with Assembly IF statements.

I'm learning assembly language and trying to do the following, pretty easy task for the Cortex M0 32bit microcontroller:

So far I just wrote the beginning which is:

MOVS R0, #1 ;a = 1
MOVS R1, #2 ;b = 2
MOVS R2, #3 ;c = 3

and here are the if statements:

if a == 1 b = b * 4 + 2

if a <= b c = 12 b = c + 4

return b // need to return to R0

How do I make it work in assembly language? It would be nice to have comments next to the code so I know what it is doing.

Parents Reply Children