summaryrefslogtreecommitdiff
path: root/newlib/libc/sys/sysnec810/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/sysnec810/crt0.s
parentf60aca96985e68c7d8a52eb7bc955fb80e132f73 (diff)
Import newlib and create makefile
Diffstat (limited to 'newlib/libc/sys/sysnec810/crt0.s')
-rw-r--r--newlib/libc/sys/sysnec810/crt0.s22
1 files changed, 22 insertions, 0 deletions
diff --git a/newlib/libc/sys/sysnec810/crt0.s b/newlib/libc/sys/sysnec810/crt0.s
new file mode 100644
index 0000000..3c7a382
--- /dev/null
+++ b/newlib/libc/sys/sysnec810/crt0.s
@@ -0,0 +1,22 @@
+ .set STACKTOP, 0x100000
+
+ .extern __tp_TEXT, 4
+ .extern __gp_DATA, 4
+ .extern _main
+ .globl __start
+ .globl _exit
+ .globl __exit
+
+ .text
+__start:
+ mov 2, r10 -- set Cache Control Word
+ ldsr r10, 24 --
+#
+ mov STACKTOP, sp -- set stack pointer
+ mov #__tp_TEXT, tp -- set tp register
+ mov #__gp_DATA, gp -- set gp register offset
+ add tp, gp -- set gp register
+ jal _main -- call main function
+__exit:
+ halt -- end of the program
+