summaryrefslogtreecommitdiff
path: root/newlib/libc/sys/h8300hms/crt0.S
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2017-12-15 09:38:53 -0500
committerPikalaxALT <pikalaxalt@gmail.com>2017-12-15 09:39:34 -0500
commitf95a4a932476be2ba99e2fd081e8d2bc6ea12813 (patch)
tree75f67192cb2d7b7b575c94edda318e475239b63c /newlib/libc/sys/h8300hms/crt0.S
parentf60aca96985e68c7d8a52eb7bc955fb80e132f73 (diff)
Import newlib and create makefile
Diffstat (limited to 'newlib/libc/sys/h8300hms/crt0.S')
-rw-r--r--newlib/libc/sys/h8300hms/crt0.S69
1 files changed, 69 insertions, 0 deletions
diff --git a/newlib/libc/sys/h8300hms/crt0.S b/newlib/libc/sys/h8300hms/crt0.S
new file mode 100644
index 0000000..94a4e29
--- /dev/null
+++ b/newlib/libc/sys/h8300hms/crt0.S
@@ -0,0 +1,69 @@
+; h8/300 and h8/300h start up file.
+
+#ifdef __H8300__
+
+ .section .text
+ .global _start
+_start:
+ mov.w #_stack,sp
+ mov.w #_edata,r0
+ mov.w #_end,r1
+ mov.w #0,r2
+.loop: mov.w r2,@r0
+ adds #2,r0
+ cmp r1,r0
+ blo .loop
+ jsr @___main
+ jsr @_main
+ jsr @_exit
+
+ .section .stack
+_stack: .word 1
+
+#endif
+
+#ifdef __H8300H__
+
+ .h8300h
+ .section .text
+ .global _start
+_start:
+ mov.l #_stack,sp
+ mov.l #_edata,er0
+ mov.l #_end,er1
+ mov.w #0,r2 ; not sure about alignment requirements
+.loop: mov.w r2,@er0 ; playing it safe for now
+ adds #2,er0
+ cmp.l er1,er0
+ blo .loop
+ jsr @___main
+ jsr @_main
+ jsr @_exit
+
+ .section .stack
+_stack: .long 1
+
+#endif
+
+#ifdef __H8300S__
+
+ .h8300s
+ .section .text
+ .global _start
+_start:
+ mov.l #_stack,sp
+ mov.l #_edata,er0
+ mov.l #_end,er1
+ mov.w #0,r2 ; not sure about alignment requirements
+.loop: mov.w r2,@er0 ; playing it safe for now
+ adds #2,er0
+ cmp.l er1,er0
+ blo .loop
+ jsr @___main
+ jsr @_main
+ jsr @_exit
+
+ .section .stack
+_stack: .long 1
+
+#endif