瀏覽代碼

+ started work on the Z80 internal assembler

git-svn-id: trunk@45191 -
nickysn 5 年之前
父節點
當前提交
19c1ecda54
共有 4 個文件被更改,包括 82 次插入0 次删除
  1. 1 0
      .gitattributes
  2. 78 0
      compiler/ogrel.pas
  3. 1 0
      compiler/systems.inc
  4. 2 0
      compiler/z80/cputarg.pas

+ 1 - 0
.gitattributes

@@ -530,6 +530,7 @@ compiler/ogmacho.pas svneol=native#text/plain
 compiler/ogmap.pas svneol=native#text/plain
 compiler/ognlm.pas svneol=native#text/plain
 compiler/ogomf.pas svneol=native#text/plain
+compiler/ogrel.pas svneol=native#text/plain
 compiler/omfbase.pas svneol=native#text/plain
 compiler/optbase.pas svneol=native#text/plain
 compiler/optconstprop.pas svneol=native#text/pascal

+ 78 - 0
compiler/ogrel.pas

@@ -0,0 +1,78 @@
+{
+    Copyright (c) 2020 by Nikolay Nikolov
+
+    Contains the ASCII relocatable object file format (*.rel) reader and writer
+    This is the object format used on the Z80 platforms.
+
+    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 ogrel;
+
+{$i fpcdefs.inc}
+
+interface
+
+    uses
+       { common }
+       cclasses,globtype,
+       { target }
+       systems,
+       { assembler }
+       cpuinfo,cpubase,aasmbase,assemble,link,
+       { output }
+       ogbase,
+       owbase;
+
+    type
+
+      { TRelAssembler }
+
+      TRelAssembler = class(tinternalassembler)
+      end;
+
+implementation
+
+    uses
+       SysUtils,
+       cutils,verbose,globals,
+       fmodule,aasmtai,aasmdata,
+       ogmap,
+       version
+       ;
+
+
+{*****************************************************************************
+                                  Initialize
+*****************************************************************************}
+    const
+       as_z80_rel_info : tasminfo =
+          (
+            id     : as_z80_rel;
+            idtxt  : 'REL';
+            asmbin : '';
+            asmcmd : '';
+            supported_targets : [system_z80_embedded,system_z80_zxspectrum];
+            flags : [af_outputbinary,af_smartlink_sections];
+            labelprefix : '..@';
+            labelmaxlen : -1;
+            comment : '; ';
+            dollarsign: '$';
+          );
+
+initialization
+  RegisterAssembler(as_z80_rel_info,TRelAssembler);
+end.

+ 1 - 0
compiler/systems.inc

@@ -258,6 +258,7 @@
              ,as_z80asm
              ,as_sdcc_sdasz80
              ,as_z80_vasm
+             ,as_z80_rel
        );
 
        tlink = (ld_none,

+ 2 - 0
compiler/z80/cputarg.pas

@@ -56,6 +56,8 @@ implementation
       ,agz80vasm
     {$endif}
 
+      ,ogrel
+
 {**************************************
         Assembler Readers
 **************************************}