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.
Get yourself a copy of this book:
store.elsevier.com/product.jsp
Andrew, thank you for the link, this book looks promising!
The Cortex-M0 assembler is more restrictive due to the way the ISA is implemented.
www.microdigitaled.com/.../ARM_ASM_books.htm
Thanks! I came up with a code, I think it'll do the trick.