Add blank_check.S
authorNIIBE Yutaka <gniibe@fsij.org>
Thu, 21 Jun 2012 10:40:41 +0000 (19:40 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Thu, 21 Jun 2012 10:40:41 +0000 (19:40 +0900)
ChangeLog
tool/asm-thumb/blank_check.S [new file with mode: 0644]

index 28e258e..0ef87fe 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-06-21  Niibe Yutaka  <gniibe@fsij.org>
+
+       * tool/asm-thumb/blank_check.S: New.
+
 2012-06-20  Niibe Yutaka  <gniibe@fsij.org>
 
        ST-Link/V2 flash ROM writer.
diff --git a/tool/asm-thumb/blank_check.S b/tool/asm-thumb/blank_check.S
new file mode 100644 (file)
index 0000000..bc421a5
--- /dev/null
@@ -0,0 +1,19 @@
+/* ARM Thumb Assembler code */
+// arm-none-eabi-gcc -Wa,-amhls=blank_check.lst -c blank_check.S
+
+       .cpu cortex-m3
+       .thumb
+       ldr     r1, .START_ADDR
+       ldr     r2, .END_ADDR
+0:     ldr     r0, [r1]
+       add     r0, r0, #1
+       bne     1f
+       add     r1, r1, #2
+       cmp     r1, r2
+       bne     0b
+1:     bkpt    #0x00
+       // success: r0=0
+       // fail:    r0!=0
+       .align  2
+.START_ADDR:   .word 0x08000000
+.END_ADDR:     .word 0x08020000