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.
I was going to type out some sample code for you, but then found myself using google to check minor detail. The detail was very easy to find. Why don't you give it a go?
I'm going to work on it today. This is the first programming language I'm trying to learn.