فهرست منبع

* i8086 specific code from tcgpointerconstnode.pass_generate_code moved to an i8086 specific overriden method

git-svn-id: trunk@24577 -
nickysn 12 سال پیش
والد
کامیت
a308994423
5فایلهای تغییر یافته به همراه83 افزوده شده و 17 حذف شده
  1. 1 0
      .gitattributes
  2. 2 2
      compiler/i8086/cpunode.pas
  3. 71 0
      compiler/i8086/n8086con.pas
  4. 3 14
      compiler/ncgcon.pas
  5. 6 1
      compiler/ppc8086.lpi

+ 1 - 0
.gitattributes

@@ -248,6 +248,7 @@ compiler/i8086/i8086prop.inc svneol=native#text/plain
 compiler/i8086/i8086tab.inc svneol=native#text/plain
 compiler/i8086/n8086add.pas svneol=native#text/plain
 compiler/i8086/n8086cal.pas svneol=native#text/plain
+compiler/i8086/n8086con.pas svneol=native#text/plain
 compiler/i8086/n8086inl.pas svneol=native#text/plain
 compiler/i8086/n8086mat.pas svneol=native#text/plain
 compiler/i8086/n8086mem.pas svneol=native#text/plain

+ 2 - 2
compiler/i8086/cpunode.pas

@@ -46,7 +46,6 @@ unit cpunode;
          after the generic one (FK)
        }
        nx86set,
-       nx86con,
        nx86cnv,
 
        n8086add,
@@ -54,7 +53,8 @@ unit cpunode;
        n8086mem{,
        n386set},
        n8086inl,
-       n8086mat
+       n8086mat,
+       n8086con
        ;
 
 end.

+ 71 - 0
compiler/i8086/n8086con.pas

@@ -0,0 +1,71 @@
+{
+    Copyright (c) 1998-2012 by Florian Klaempfl and others
+
+    Generate i8086 assembler for constants
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    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.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ ****************************************************************************
+}
+unit n8086con;
+
+{$i fpcdefs.inc}
+
+interface
+
+    uses
+       node,ncon,ncgcon,nx86con;
+
+    type
+
+      { tcgpointerconstnode }
+
+      ti8086pointerconstnode = class(tcgpointerconstnode)
+        procedure pass_generate_code;override;
+      end;
+
+implementation
+
+    uses
+      systems,globals,globtype,
+      symconst,symdef,
+      defutil,
+      cpubase,
+      cga,cgx86,cgobj,cgbase,cgutils;
+
+    {*****************************************************************************
+                               T8086POINTERCONSTNODE
+    *****************************************************************************}
+
+    procedure ti8086pointerconstnode.pass_generate_code;
+      begin
+        { far pointer? }
+        if (typedef.typ=pointerdef) and (tpointerdef(typedef).x86pointertyp in [x86pt_far,x86pt_huge]) then
+          begin
+            location_reset(location,LOC_CONSTANT,OS_32);
+            location.value:=longint(value);
+          end
+        else
+          begin
+            { an integer const. behaves as a memory reference }
+            location_reset(location,LOC_CONSTANT,OS_ADDR);
+            location.value:=aint(value);
+          end;
+      end;
+
+
+begin
+  cpointerconstnode:=ti8086pointerconstnode;
+end.

+ 3 - 14
compiler/ncgcon.pas

@@ -245,20 +245,9 @@ implementation
 
     procedure tcgpointerconstnode.pass_generate_code;
       begin
-{$ifdef i8086}
-         { far pointer? }
-         if (typedef.typ=pointerdef) and (tpointerdef(typedef).x86pointertyp in [x86pt_far,x86pt_huge]) then
-           begin
-             location_reset(location,LOC_CONSTANT,OS_32);
-             location.value:=longint(value);
-           end
-         else
-{$endif i8086}
-           begin
-             { an integer const. behaves as a memory reference }
-             location_reset(location,LOC_CONSTANT,OS_ADDR);
-             location.value:=aint(value);
-           end;
+         { an integer const. behaves as a memory reference }
+         location_reset(location,LOC_CONSTANT,OS_ADDR);
+         location.value:=aint(value);
       end;
 
 

+ 6 - 1
compiler/ppc8086.lpi

@@ -28,7 +28,7 @@
         <LaunchingApplication PathPlusParams="\usr\X11R6\bin\xterm -T 'Lazarus Run Output' -e $(LazarusDir)\tools\runwait.sh $(TargetCmdLine)"/>
       </local>
     </RunParams>
-    <Units Count="16">
+    <Units Count="17">
       <Unit0>
         <Filename Value="pp.pas"/>
         <IsPartOfProject Value="True"/>
@@ -108,6 +108,11 @@
         <IsPartOfProject Value="True"/>
         <UnitName Value="n8086cal"/>
       </Unit15>
+      <Unit16>
+        <Filename Value="i8086\n8086con.pas"/>
+        <IsPartOfProject Value="True"/>
+        <UnitName Value="n8086con"/>
+      </Unit16>
     </Units>
   </ProjectOptions>
   <CompilerOptions>