ソースを参照

AROS: startupcode for arm-aros

git-svn-id: trunk@34820 -
marcus 8 年 前
コミット
f8a7708741
2 ファイル変更67 行追加0 行削除
  1. 1 0
      .gitattributes
  2. 66 0
      rtl/aros/arm/prt0.as

+ 1 - 0
.gitattributes

@@ -8373,6 +8373,7 @@ rtl/arm/thumb.inc svneol=native#text/plain
 rtl/arm/thumb2.inc svneol=native#text/plain
 rtl/aros/Makefile svneol=native#text/plain
 rtl/aros/Makefile.fpc svneol=native#text/plain
+rtl/aros/arm/prt0.as svneol=native#text/plain
 rtl/aros/doslibd.inc svneol=native#text/plain
 rtl/aros/i386/doslibf.inc svneol=native#text/plain
 rtl/aros/i386/execd.inc svneol=native#text/plain

+ 66 - 0
rtl/aros/arm/prt0.as

@@ -0,0 +1,66 @@
+/* 
+  This file is part of the Free Pascal run time library.
+  Copyright (c) 2016 by Marcus Sackrow
+
+  Startup code for AROS/ARM RTL
+
+  See the file COPYING.FPC, included in this distribution,
+  for details about the copyright.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY;without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  */
+  
+	.text
+	.globl _start
+	.type _start,#function
+_start:
+	push {r0-r12,r14}
+	ldr ip,=_Backjump
+	str lr,[ip]
+	// ExecBase
+	ldr ip,=_ExecBase
+	str r5, [ip]  // Execbase seems to be in r5 ;-)
+
+  // Save initial stackpointer 
+	ldr ip,=__stkptr
+	str sp,[ip]
+	
+	bl PASCALMAIN
+
+	//mov r0,#71
+	//bl _RawCharS
+	//mov r0,#10
+	//bl _RawCharS
+
+	.globl  _haltproc
+	.type   _haltproc,#function
+_haltproc:
+	
+	ldr ip,=__stkptr
+	ldr sp,[ip]
+
+	pop {r0-r12,r14}
+
+  // TODO: exitcode should be r0
+
+	ldr ip,=_Backjump
+	ldr lr,[ip]
+	bx lr
+	
+
+	/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long 0
+	.weak data_start
+	data_start = __data_start
+
+.bss
+  .comm __stkptr,4
+	.comm _ExecBase,4
+	.comm _Backjump,4
+
+