summaryrefslogtreecommitdiff
path: root/newlib/libc/sys/sysvnecv70/crt0.s
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys/sysvnecv70/crt0.s')
-rw-r--r--newlib/libc/sys/sysvnecv70/crt0.s28
1 files changed, 28 insertions, 0 deletions
diff --git a/newlib/libc/sys/sysvnecv70/crt0.s b/newlib/libc/sys/sysvnecv70/crt0.s
new file mode 100644
index 00000000000..7c4bc77cfbe
--- /dev/null
+++ b/newlib/libc/sys/sysvnecv70/crt0.s
@@ -0,0 +1,28 @@
+ .globl start
+start:
+ sub.w #0x8,sp
+ mov.w 0x8[sp],[sp]
+ movea.w 0xc[sp],r0
+ mov.w r0,0x4[sp]
+tloop: test.w [r0+]
+ jne tloop
+ cmp.w r0,[0x4[sp]]
+ jge l1
+ sub.w #0x4,r0
+l1: mov.w r0,0x8[sp]
+ mov.w r0,_environ
+
+
+ call _main,[sp]
+ add.w #0xc,sp
+ push r0
+ call _exit,[sp]
+ add.w #0x4,sp
+ chlvl #0,#1
+
+ .data
+
+ .globl _environ
+_environ:
+ .word 0
+