瀏覽代碼

slight rtl update for i8086-msdos

git-svn-id: branches/i8086@23777 -
nickysn 12 年之前
父節點
當前提交
3768914a3d
共有 9 個文件被更改,包括 149 次插入0 次删除
  1. 5 0
      .gitattributes
  2. 15 0
      rtl/i8086/i8086.inc
  3. 23 0
      rtl/i8086/setjump.inc
  4. 22 0
      rtl/i8086/setjumph.inc
  5. 8 0
      rtl/inc/system.inc
  6. 15 0
      rtl/inc/systemh.inc
  7. 16 0
      rtl/msdos/sysos.inc
  8. 26 0
      rtl/msdos/sysosh.inc
  9. 19 0
      rtl/msdos/system.pp

+ 5 - 0
.gitattributes

@@ -7783,6 +7783,9 @@ rtl/i386/setjumph.inc svneol=native#text/plain
 rtl/i386/strings.inc svneol=native#text/plain
 rtl/i386/stringss.inc svneol=native#text/plain
 rtl/i386/strpas.inc svneol=native#text/plain
+rtl/i8086/i8086.inc svneol=native#text/plain
+rtl/i8086/setjump.inc svneol=native#text/plain
+rtl/i8086/setjumph.inc svneol=native#text/plain
 rtl/inc/aliases.inc svneol=native#text/plain
 rtl/inc/astrings.inc svneol=native#text/plain
 rtl/inc/cgeneric.inc svneol=native#text/plain
@@ -8191,6 +8194,8 @@ rtl/morphos/varutils.pp svneol=native#text/plain
 rtl/morphos/video.pp svneol=native#text/plain
 rtl/morphos/videodata.inc svneol=native#text/plain
 rtl/msdos/prt0.asm svneol=native#text/plain
+rtl/msdos/sysos.inc svneol=native#text/plain
+rtl/msdos/sysosh.inc svneol=native#text/plain
 rtl/msdos/system.pp svneol=native#text/plain
 rtl/nativent/Makefile svneol=native#text/plain
 rtl/nativent/Makefile.fpc svneol=native#text/plain

+ 15 - 0
rtl/i8086/i8086.inc

@@ -0,0 +1,15 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2013 by the Free Pascal development team.
+
+    Processor dependent implementation for the system unit for
+    intel i8086+
+
+    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.
+
+ **********************************************************************}

+ 23 - 0
rtl/i8086/setjump.inc

@@ -0,0 +1,23 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2013 by the Free Pascal development team
+
+    SetJmp and LongJmp implementation for exception handling
+
+    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.
+
+ **********************************************************************}
+
+Function fpc_SetJmp (Var S : Jmp_buf) : longint;assembler;nostackframe;[Public, alias : 'FPC_SETJMP']; compilerproc;
+asm
+end;
+
+
+Procedure fpc_longJmp (Var S : Jmp_buf; value : longint); assembler;nostackframe;[Public, alias : 'FPC_LONGJMP']; compilerproc;
+asm
+end;

+ 22 - 0
rtl/i8086/setjumph.inc

@@ -0,0 +1,22 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2013 the Free Pascal development team
+
+    SetJmp/Longjmp declarations
+
+    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.
+
+ **********************************************************************}
+
+Type
+  jmp_buf = packed record
+  end;
+  PJmp_buf = ^jmp_buf;
+
+Function Setjmp (Var S : Jmp_buf) : longint; [external name 'FPC_SETJMP'];
+Procedure longjmp (Var S : Jmp_buf; value : longint); [external name 'FPC_LONGJMP'];

+ 8 - 0
rtl/inc/system.inc

@@ -157,6 +157,14 @@ function do_isdevice(handle:thandle):boolean;forward;
   {$define SYSPROCDEFINED}
 {$endif cpui386}
 
+{$ifdef cpui8086}
+  {$ifdef SYSPROCDEFINED}
+    {$Error Can't determine processor type !}
+  {$endif}
+  {$i i8086.inc}  { Case dependent, don't change }
+  {$define SYSPROCDEFINED}
+{$endif cpui8086}
+
 {$ifdef cpum68k}
   {$ifdef SYSPROCDEFINED}
     {$Error Can't determine processor type !}

+ 15 - 0
rtl/inc/systemh.inc

@@ -114,6 +114,21 @@ Type
   {$endif}
 {$endif CPUI386}
 
+{$ifdef CPUI8086}
+  {$define CPU16}
+
+  {$define DEFAULT_EXTENDED}
+
+  {$define SUPPORT_SINGLE}
+  {$define SUPPORT_DOUBLE}
+  {$define SUPPORT_EXTENDED}
+  {$define SUPPORT_COMP}
+
+  {$ifndef FPUNONE}
+    ValReal = Extended;
+  {$endif}
+{$endif CPUI8086}
+
 {$ifdef CPUX86_64}
 {$ifdef FPC_HAS_TYPE_EXTENDED}
   { win64 doesn't support the legacy fpu }

+ 16 - 0
rtl/msdos/sysos.inc

@@ -0,0 +1,16 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2013 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    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.
+
+ **********************************************************************}

+ 26 - 0
rtl/msdos/sysosh.inc

@@ -0,0 +1,26 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2013 by Free Pascal development team
+
+    This file implements all the base types and limits required
+    for a minimal POSIX compliant subset required to port the compiler
+    to a new OS.
+
+    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.
+
+ **********************************************************************}
+
+{Platform specific information}
+type
+  THandle = Longint;
+  TThreadID = THandle;
+
+   PRTLCriticalSection = ^TRTLCriticalSection;
+   TRTLCriticalSection = record
+     Locked: boolean
+   end;

+ 19 - 0
rtl/msdos/system.pp

@@ -4,14 +4,32 @@ unit system;
 
 interface
 
+{$ifdef FULL_RTL}
+{$I systemh.inc}
+{$endif FULL_RTL}
+
+const
+  maxExitCode = 255;
+
+{$ifndef FULL_RTL}
 type
+  DWord = LongWord;
+  Cardinal = LongWord;
+  Integer = SmallInt;
+  UInt64 = QWord;
+
   HRESULT = LongInt;
+{$endif FULL_RTL}
 
 procedure DebugWrite(const S: string);
 procedure DebugWriteLn(const S: string);
 
 implementation
 
+{$ifdef FULL_RTL}
+{$I system.inc}
+{$endif FULL_RTL}
+
 procedure fpc_Initialize_Units;[public,alias:'FPC_INITIALIZEUNITS']; compilerproc;
 begin
 end;
@@ -32,6 +50,7 @@ begin
     mov cl, al
     xor ch, ch
     mov ah, 2
+
 @@1:
     lodsb
     mov dl, al