Bläddra i källkod

+ basic system unit for avr-embedded
* fixed several compiler stuff to be able to start system unit compilation on avr

git-svn-id: trunk@10318 -

florian 17 år sedan
förälder
incheckning
c05d4912f4

+ 7 - 0
.gitattributes

@@ -4731,6 +4731,13 @@ rtl/atari/prt0.as svneol=native#text/plain
 rtl/atari/readme -text
 rtl/atari/readme -text
 rtl/atari/sysatari.pas svneol=native#text/plain
 rtl/atari/sysatari.pas svneol=native#text/plain
 rtl/atari/system.pas svneol=native#text/plain
 rtl/atari/system.pas svneol=native#text/plain
+rtl/avr/avr.inc svneol=native#text/plain
+rtl/avr/int64p.inc svneol=native#text/plain
+rtl/avr/makefile.cpu svneol=native#text/plain
+rtl/avr/math.inc svneol=native#text/plain
+rtl/avr/set.inc svneol=native#text/plain
+rtl/avr/setjump.inc svneol=native#text/plain
+rtl/avr/setjumph.inc svneol=native#text/plain
 rtl/beos/Makefile svneol=native#text/plain
 rtl/beos/Makefile svneol=native#text/plain
 rtl/beos/Makefile.fpc svneol=native#text/plain
 rtl/beos/Makefile.fpc svneol=native#text/plain
 rtl/beos/baseunix.pp svneol=native#text/plain
 rtl/beos/baseunix.pp svneol=native#text/plain

+ 1 - 1
compiler/avr/cpuinfo.pas

@@ -46,7 +46,7 @@ Const
    {# Size of a multimedia register               }
    {# Size of a multimedia register               }
    mmreg_size = 16;
    mmreg_size = 16;
    { target cpu string (used by compiler options) }
    { target cpu string (used by compiler options) }
-   target_cpu_string = 'arm';
+   target_cpu_string = 'avr';
 
 
    { calling conventions supported by the code generator }
    { calling conventions supported by the code generator }
    supported_calling_conventions : tproccalloptions = [
    supported_calling_conventions : tproccalloptions = [

+ 9 - 0
compiler/options.pas

@@ -2270,6 +2270,15 @@ begin
   def_system_macro('FPC_CURRENCY_IS_INT64');
   def_system_macro('FPC_CURRENCY_IS_INT64');
   def_system_macro('FPC_COMP_IS_INT64');
   def_system_macro('FPC_COMP_IS_INT64');
 {$endif arm}
 {$endif arm}
+{$ifdef avr}
+  def_system_macro('CPUAVR');
+  def_system_macro('CPU16');
+  def_system_macro('FPC_HAS_TYPE_DOUBLE');
+  def_system_macro('FPC_HAS_TYPE_SINGLE');
+  def_system_macro('FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE');
+  def_system_macro('FPC_CURRENCY_IS_INT64');
+  def_system_macro('FPC_COMP_IS_INT64');
+{$endif avr}
 
 
   { read configuration file }
   { read configuration file }
   if (not disable_configfile) and
   if (not disable_configfile) and

+ 15 - 2
compiler/psystem.pas

@@ -191,17 +191,30 @@ implementation
         s80floattype:=tfloatdef.create(s80real);
         s80floattype:=tfloatdef.create(s80real);
         s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
         s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
 {$endif arm}
 {$endif arm}
+{$ifdef avr}
+        s32floattype:=tfloatdef.create(s32real);
+        s64floattype:=tfloatdef.create(s64real);
+        s80floattype:=tfloatdef.create(s80real);
+        s64currencytype:=torddef.create(scurrency,low(int64),high(int64));
+{$endif avr}
 {$ifdef cpu64bit}
 {$ifdef cpu64bit}
         uinttype:=u64inttype;
         uinttype:=u64inttype;
         sinttype:=s64inttype;
         sinttype:=s64inttype;
         ptruinttype:=u64inttype;
         ptruinttype:=u64inttype;
         ptrsinttype:=s64inttype;
         ptrsinttype:=s64inttype;
-{$else cpu64bit}
+{$endif cpu64bit}
+{$ifdef cpu32bit}
         uinttype:=u32inttype;
         uinttype:=u32inttype;
         sinttype:=s32inttype;
         sinttype:=s32inttype;
         ptruinttype:=u32inttype;
         ptruinttype:=u32inttype;
         ptrsinttype:=s32inttype;
         ptrsinttype:=s32inttype;
-{$endif cpu64bit}
+{$endif cpu32bit}
+{$ifdef cpu16bit}
+        uinttype:=u16inttype;
+        sinttype:=s16inttype;
+        ptruinttype:=u16inttype;
+        ptrsinttype:=s16inttype;
+{$endif cpu16bit}
         { some other definitions }
         { some other definitions }
         voidpointertype:=tpointerdef.create(voidtype);
         voidpointertype:=tpointerdef.create(voidtype);
         charpointertype:=tpointerdef.create(cchartype);
         charpointertype:=tpointerdef.create(cchartype);

+ 9 - 3
compiler/systems.pas

@@ -51,7 +51,8 @@ interface
              cpu_x86_64,                   { 8 }
              cpu_x86_64,                   { 8 }
              cpu_mips,                     { 9 }
              cpu_mips,                     { 9 }
              cpu_arm,                      { 10 }
              cpu_arm,                      { 10 }
-             cpu_powerpc64                 { 11 }
+             cpu_powerpc64,                { 11 }
+             cpu_avr                       { 12 }
        );
        );
 
 
        tasmmode= (asmmode_none
        tasmmode= (asmmode_none
@@ -141,7 +142,8 @@ interface
              system_powerpc64_embedded, { 58 }
              system_powerpc64_embedded, { 58 }
              system_i386_symbian,       { 59 }
              system_i386_symbian,       { 59 }
              system_arm_symbian,        { 60 }
              system_arm_symbian,        { 60 }
-             system_x86_64_darwin       { 61 }
+             system_x86_64_darwin,      { 61 }
+             system_avr_embedded        { 62 }
        );
        );
 
 
      type
      type
@@ -410,7 +412,7 @@ interface
 
 
        cpu2str : array[TSystemCpu] of string[10] =
        cpu2str : array[TSystemCpu] of string[10] =
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
             ('','i386','m68k','alpha','powerpc','sparc','vm','ia64','x86_64',
-             'mips','arm', 'powerpc64');
+             'mips','arm', 'powerpc64', 'avr');
 
 
        abi2str : array[tabi] of string[10] =
        abi2str : array[tabi] of string[10] =
          ('default','sysv','aix','eabi','armeb');
          ('default','sysv','aix','eabi','armeb');
@@ -923,6 +925,10 @@ begin
   {$endif WINDOWS}
   {$endif WINDOWS}
   {$endif cpuarm}
   {$endif cpuarm}
 {$endif arm}
 {$endif arm}
+
+{$ifdef avr}
+  default_target(system_avr_embedded);
+{$endif avr}
 end;
 end;
 
 
 
 

+ 67 - 2
compiler/systems/i_embed.pas

@@ -86,12 +86,77 @@ unit i_embed;
             abi : abi_default
             abi : abi_default
           );
           );
 
 
+       system_avr_embedded_info : tsysteminfo =
+          (
+            system       : system_avr_embedded;
+            name         : 'Embedded';
+            shortname    : 'embedded';
+            flags        : [tf_needs_symbol_size,tf_files_case_sensitive,tf_use_function_relative_addresses
+	                          ,tf_smartlink_sections];
+            cpu          : cpu_avr;
+            unit_env     : '';
+            extradefines : '';
+            exeext       : '';
+            defext       : '.def';
+            scriptext    : '.sh';
+            smartext     : '.sl';
+            unitext      : '.ppu';
+            unitlibext   : '.ppl';
+            asmext       : '.s';
+            objext       : '.o';
+            resext       : '.res';
+            resobjext    : '.or';
+            sharedlibext : '.so';
+            staticlibext : '.a';
+            staticlibprefix : 'libp';
+            sharedlibprefix : 'lib';
+            sharedClibext : '.so';
+            staticClibext : '.a';
+            staticClibprefix : 'lib';
+            sharedClibprefix : 'lib';
+            Cprefix      : '';
+            newline      : #10;
+            dirsep       : '/';
+            assem        : as_gas;
+            assemextern  : as_gas;
+            link         : nil;
+            linkextern   : nil;
+            ar           : ar_gnu_ar;
+            res          : res_none;
+            dbg          : dbg_stabs;
+            script       : script_unix;
+            endian       : endian_little;
+            alignment    :
+              (
+                procalign       : 4;
+                loopalign       : 4;
+                jumpalign       : 0;
+                constalignmin   : 0;
+                constalignmax   : 4;
+                varalignmin     : 0;
+                varalignmax     : 4;
+                localalignmin   : 4;
+                localalignmax   : 8;
+                recordalignmin  : 0;
+                recordalignmax  : 4;
+                maxCrecordalign : 4
+              );
+            first_parm_offset : 0;
+            stacksize    : 1024;
+            abi : abi_default
+          );
+
   implementation
   implementation
 
 
 initialization
 initialization
-{$ifdef arm}
+{$ifdef CPUARM}
   {$ifdef embedded}
   {$ifdef embedded}
     set_source_info(system_arm_embedded_info);
     set_source_info(system_arm_embedded_info);
   {$endif embedded}
   {$endif embedded}
-{$endif arm}
+{$endif CPUARM}
+{$ifdef CPUAVR}
+  {$ifdef embedded}
+    set_source_info(system_avr_embedded_info);
+  {$endif embedded}
+{$endif CPUAVR}
 end.
 end.

+ 7 - 0
compiler/systems/t_embed.pas

@@ -284,6 +284,13 @@ end;
 *****************************************************************************}
 *****************************************************************************}
 
 
 initialization
 initialization
+{$ifdef arm}
   RegisterExternalLinker(system_arm_embedded_info,TlinkerEmbedded);
   RegisterExternalLinker(system_arm_embedded_info,TlinkerEmbedded);
   RegisterTarget(system_arm_embedded_info);
   RegisterTarget(system_arm_embedded_info);
+{$endif arm}
+
+{$ifdef avr}
+  RegisterExternalLinker(system_avr_embedded_info,TlinkerEmbedded);
+  RegisterTarget(system_avr_embedded_info);
+{$endif avr}
 end.
 end.

+ 23 - 0
rtl/avr/avr.inc

@@ -0,0 +1,23 @@
+{
+
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by the Free Pascal development team.
+
+    Processor dependent implementation for the system unit for
+    AVR
+
+    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.
+
+ **********************************************************************}
+
+{$asmmode gas}
+
+procedure fpc_cpuinit;
+begin
+  SysInitFPU;
+end;

+ 14 - 0
rtl/avr/int64p.inc

@@ -0,0 +1,14 @@
+{
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by the Free Pascal development team
+
+    This file contains some helper routines for int64 and qword
+
+    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.
+
+ **********************************************************************}

+ 6 - 0
rtl/avr/makefile.cpu

@@ -0,0 +1,6 @@
+#
+# Here we set processor dependent include file names.
+#
+
+CPUNAMES=
+CPUINCNAMES=$(addsuffix .inc,$(CPUNAMES))

+ 15 - 0
rtl/avr/math.inc

@@ -0,0 +1,15 @@
+{
+
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by the Free Pascal development team.
+
+    Implementation of mathematical Routines (only for real)
+
+    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.
+
+ **********************************************************************}

+ 15 - 0
rtl/avr/set.inc

@@ -0,0 +1,15 @@
+{
+
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by the Free Pascal development team.
+
+    Include file with set operations called by the compiler
+
+    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/avr/setjump.inc

@@ -0,0 +1,26 @@
+{
+
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 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 setjmp(var S : jmp_buf) : longint;assembler;[Public, alias : 'FPC_SETJMP'];nostackframe;
+  asm
+  end;
+
+
+procedure longjmp(var S : jmp_buf;value : longint);assembler;[Public, alias : 'FPC_LONGJMP'];
+  asm
+  end;
+
+

+ 25 - 0
rtl/avr/setjumph.inc

@@ -0,0 +1,25 @@
+{
+
+    This file is part of the Free Pascal run time library.
+    Copyright (c) 2008 by 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;
+procedure longjmp(var S : jmp_buf;value : longint);
+
+

+ 13 - 5
rtl/embedded/Makefile

@@ -1,8 +1,8 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/11/08]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/02/12]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
@@ -249,8 +249,7 @@ COMMON=$(RTL)/common
 PROCINC=$(RTL)/$(CPU_TARGET)
 PROCINC=$(RTL)/$(CPU_TARGET)
 UNITPREFIX=rtl
 UNITPREFIX=rtl
 SYSTEMUNIT=system
 SYSTEMUNIT=system
-override FPCOPT+=
-rtl.cfg
+override [email protected]
 ifdef RELEASE
 ifdef RELEASE
 override FPCOPT+=-Ur
 override FPCOPT+=-Ur
 endif
 endif
@@ -415,6 +414,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_UNITS+=$(SYSTEMUNIT) # objpas macpas strings
 override TARGET_UNITS+=$(SYSTEMUNIT) # objpas macpas strings
 endif
 endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override TARGET_UNITS+=$(SYSTEMUNIT) # objpas macpas strings
+endif
 override INSTALL_FPCPACKAGE=y
 override INSTALL_FPCPACKAGE=y
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
@@ -575,6 +577,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
 endif
 endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_INCLUDEDIR+=$(INC) $(PROCINC)
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 ifeq ($(FULL_TARGET),i386-linux)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
 endif
@@ -734,6 +739,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
 endif
 endif
+ifeq ($(FULL_TARGET),avr-embedded)
+override COMPILER_SOURCEDIR+=$(INC) $(PROCINC) $(COMMON)
+endif
 ifdef REQUIRE_UNITSDIR
 ifdef REQUIRE_UNITSDIR
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 override UNITSDIR+=$(REQUIRE_UNITSDIR)
 endif
 endif
@@ -1635,7 +1643,7 @@ endif
 endif
 endif
 endif
 endif
 .PHONY: fpc_units
 .PHONY: fpc_units
-ifneq ($(TARGET_UNITS),)
+ifneq ($(TARGET_UNITS)$(TARGET_IMPLICITUNITS),)
 override ALLTARGET+=fpc_units
 override ALLTARGET+=fpc_units
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override UNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_UNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))
 override IMPLICITUNITPPUFILES=$(addsuffix $(PPUEXT),$(TARGET_IMPLICITUNITS))

+ 1 - 2
rtl/embedded/Makefile.fpc

@@ -39,8 +39,7 @@ COMMON=$(RTL)/common
 PROCINC=$(RTL)/$(CPU_TARGET)
 PROCINC=$(RTL)/$(CPU_TARGET)
 UNITPREFIX=rtl
 UNITPREFIX=rtl
 SYSTEMUNIT=system
 SYSTEMUNIT=system
-override FPCOPT+=
-rtl.cfg
+override [email protected]
 
 
 ifdef RELEASE
 ifdef RELEASE
 override FPCOPT+=-Ur
 override FPCOPT+=-Ur

+ 16 - 6
rtl/inc/system.inc

@@ -25,13 +25,15 @@
 {$i filerec.inc}
 {$i filerec.inc}
 {$i textrec.inc}
 {$i textrec.inc}
 
 
-{$ifdef FPC_OBJFPC_EXTENDED_IF}
-  {$if High(errorcode)<>maxExitCode}
+{$ifdef FPC_HAS_FEATURE_EXITCODE}
+  {$ifdef FPC_OBJFPC_EXTENDED_IF}
+    {$if High(errorcode)<>maxExitCode}
+      {$define FPC_LIMITED_EXITCODE}
+    {$endif}
+  {$else}
     {$define FPC_LIMITED_EXITCODE}
     {$define FPC_LIMITED_EXITCODE}
-  {$endif}
-{$else}
-  {$define FPC_LIMITED_EXITCODE}
-{$endif FPC_OBJFPC_EXTENDED_IF}
+  {$endif FPC_OBJFPC_EXTENDED_IF}
+{$endif FPC_HAS_FEATURE_EXITCODE}
 
 
 Procedure HandleError (Errno : Longint); forward;
 Procedure HandleError (Errno : Longint); forward;
 Procedure HandleErrorFrame (Errno : longint;frame : Pointer); forward;
 Procedure HandleErrorFrame (Errno : longint;frame : Pointer); forward;
@@ -174,6 +176,14 @@ function do_isdevice(handle:thandle):boolean;forward;
   {$define SYSPROCDEFINED}
   {$define SYSPROCDEFINED}
 {$endif cpuarm}
 {$endif cpuarm}
 
 
+{$ifdef cpuavr}
+  {$ifdef SYSPROCDEFINED}
+    {$Error Can't determine processor type !}
+  {$endif}
+  {$i avr.inc}  { Case dependent, don't change }
+  {$define SYSPROCDEFINED}
+{$endif cpuavr}
+
 
 
 procedure fillchar(var x;count : SizeInt;value : boolean);{$ifdef SYSTEMINLINE}inline;{$endif}
 procedure fillchar(var x;count : SizeInt;value : boolean);{$ifdef SYSTEMINLINE}inline;{$endif}
 begin
 begin

+ 28 - 0
rtl/inc/systemh.inc

@@ -195,6 +195,25 @@ Type
   FarPointer = Pointer;
   FarPointer = Pointer;
 {$endif CPUARM}
 {$endif CPUARM}
 
 
+{$ifdef CPUAVR}
+  {$define DEFAULT_SINGLE}
+
+  {$define SUPPORT_SINGLE}
+  {$define SUPPORT_DOUBLE}
+
+  {$define FPC_INCLUDE_SOFTWARE_MOD_DIV}
+  {$define FPC_INCLUDE_SOFTWARE_SHIFT_INT64}
+  {$define FPC_INCLUDE_SOFTWARE_INT64_TO_DOUBLE}
+
+  ValReal = Real;
+
+  { map comp to int64, but this doesn't mean we compile the comp support in! }
+  Comp = Int64;
+  PComp = ^Comp;
+
+  FarPointer = Pointer;
+{$endif CPUARM}
+
 {$ifdef CPU64}
 {$ifdef CPU64}
   SizeInt = Int64;
   SizeInt = Int64;
   SizeUInt = QWord;
   SizeUInt = QWord;
@@ -213,6 +232,15 @@ Type
   ValUInt = Cardinal;
   ValUInt = Cardinal;
 {$endif CPU32}
 {$endif CPU32}
 
 
+{$ifdef CPU16}
+  SizeInt = Integer;
+  SizeUInt = Word;
+  PtrInt = Integer;
+  PtrUInt = Word;
+  ValSInt = Integer;
+  ValUInt = Word;
+{$endif CPU16}
+
 { Zero - terminated strings }
 { Zero - terminated strings }
   PChar               = ^Char;
   PChar               = ^Char;
   PPChar              = ^PChar;
   PPChar              = ^PChar;