static RAM (.data) usage
[cortex-from-scratch] / start.asm
index 8991594..8af6fea 100644 (file)
--- a/start.asm
+++ b/start.asm
@@ -9,14 +9,23 @@ _start:
 
 /* Start of main program */
 start:
-       movs r0, #10
-       movs r1, #5
+       movs r0, #5
+       movs r1, #1
 loop:
        adds r1, r0
        subs r0, #1
        bne loop
-/* Result is now in R1 */
+       /* Result is now in R1 */
+       ldr r0, =Result
+       str r1, [r0] 
+
 deadloop:
        b deadloop
+
+       .data
+       .word 0 /* add two words*/
+       .word 0 
+Result:
+       .word 0 /* results now is in 0x20000008 (0x20000000 + 2 w) */
        .end