From cde3dd3a877ec719ae8e9cb3e07e46d0a344697c Mon Sep 17 00:00:00 2001 From: Karoly Balogh Date: Sun, 19 Nov 2023 13:29:17 +0100 Subject: [PATCH] m68k: first bit of a Human68k RTL - a very dummy startup code --- rtl/human68k/si_prc.pp | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 rtl/human68k/si_prc.pp diff --git a/rtl/human68k/si_prc.pp b/rtl/human68k/si_prc.pp new file mode 100644 index 0000000000..f6fd243789 --- /dev/null +++ b/rtl/human68k/si_prc.pp @@ -0,0 +1,43 @@ +{ + This file is part of the Free Pascal run time library. + Copyright (c) 2016 by the Free Pascal development team + + System Entry point for Human 68k (Sharp X68000) + + 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. + + **********************************************************************} + +unit si_prc; + +interface + +implementation + +var + stacktop: pointer; public name '__stktop'; + stklen: longint; external name '__stklen'; + + +procedure PascalMain; external name 'PASCALMAIN'; + + +{ this function must be the first in this unit which contains code } +{$OPTIMIZATION OFF} +procedure _FPC_proc_start; cdecl; public name '_start'; +begin + PASCALMAIN; +end; + +procedure _FPC_proc_halt(_ExitCode: longint); cdecl; assembler public name '_haltproc'; +asm + dc.w $ff00 { _EXIT } +end; + + +end.