X-Git-Url: https://robinkrens.nl/gitweb/?a=blobdiff_plain;f=start.asm;h=8af6feac6ef3e1640b829cd0e1750bf8b8dbacb9;hb=2dcce7050a791e5b3ff81e9c785d05aa79f57ba0;hp=89915941c2c2b3c8e4ee5c5e508cd44b38e560df;hpb=fe0e1e676b1d1a3f151dbe8cdf7a54ec78e1723f;p=cortex-from-scratch diff --git a/start.asm b/start.asm index 8991594..8af6fea 100644 --- 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