--- /dev/null
+/*****************************************************************
+ * Initialize data: copy data
+ * from __data_load_start ( = _etext) to __data_start
+ * can be overwriten by user function with the same name
+ *****************************************************************/
+ .section .init4, "ax", @progbits
+
+ .weak __do_copy_data
+ .func __do_copy_data
+
+__do_copy_data:
+ mov #__data_size, r15
+ tst r15
+ jz .L__copy_data_end
+.L__copy_data_loop:
+ decd r15
+#if defined(__MSP430X__) && !defined(__MSP430X_ADDR_16BIT__)
+ ; __data_load_start can be anywhere, use 430X instruction
+ movx.w __data_load_start(r15), __data_start(r15) ; data section is word-aligned, so word transfer is acceptable
+#else
+ ; __data_load_start is in lower 64K, RAM is in lower 64K, use 430 instruction
+ mov.w __data_load_start(r15), __data_start(r15) ; data section is word-aligned, so word transfer is acceptable
+#endif
+ jne .L__copy_data_loop
+.L__copy_data_end:
+
+ .endfunc