X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=src%2Fstdlib%2F__do_clear_bss.S;fp=src%2Fstdlib%2F__do_clear_bss.S;h=bd15762db0297e53da539234b23a78bc28323be6;hb=6f720ff00773571c2fa2d35e67bff68547617639;hp=0000000000000000000000000000000000000000;hpb=807b2dd5b7365eb87b482197af3b4a3f520c14f7;p=msp430-libc.git diff --git a/src/stdlib/__do_clear_bss.S b/src/stdlib/__do_clear_bss.S new file mode 100644 index 0000000..bd15762 --- /dev/null +++ b/src/stdlib/__do_clear_bss.S @@ -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