]> oss.titaniummirror.com Git - msp430-libc.git/blobdiff - src/stdlib/__do_clear_bss.S
Imported msp430-libc-20100207
[msp430-libc.git] / src / stdlib / __do_clear_bss.S
diff --git a/src/stdlib/__do_clear_bss.S b/src/stdlib/__do_clear_bss.S
new file mode 100644 (file)
index 0000000..bd15762
--- /dev/null
@@ -0,0 +1,21 @@
+/*****************************************************************
+ * Initialize data: clear .bss
+ * can be overwriten by user function with the same name
+ *****************************************************************/
+        .section .init4, "ax", @progbits
+
+        .weak   __do_clear_bss
+        .func   __do_clear_bss
+
+__do_clear_bss:
+        mov     #__bss_size, r15
+        tst     r15
+        jz      .L__clear_bss_end
+.L__clear_bss_loop:
+        dec     r15
+        clr.b   __bss_start(r15)    ; RAM is always in lower 64K, so 430 instruction
+                                    ; is acceptable here for 430X core too.
+        jne     .L__clear_bss_loop
+.L__clear_bss_end:
+
+        .endfunc