Kaynağa Gözat

* limit the ZX Spectrum programs address space up to $FDFC, because the RTL now
installs an interrupt handler at $FDFD

git-svn-id: trunk@45678 -

nickysn 5 yıl önce
ebeveyn
işleme
e41912b076
2 değiştirilmiş dosya ile 21 ekleme ve 1 silme
  1. 20 0
      compiler/ogrel.pas
  2. 1 1
      compiler/systems/t_zxspectrum.pas

+ 20 - 0
compiler/ogrel.pas

@@ -131,6 +131,13 @@ interface
         constructor create;override;
         constructor create;override;
       end;
       end;
 
 
+      { TZXSpectrumIntelHexExeOutput }
+
+      TZXSpectrumIntelHexExeOutput = class(TIntelHexExeOutput)
+      public
+        constructor create;override;
+      end;
+
 implementation
 implementation
 
 
     uses
     uses
@@ -1321,6 +1328,19 @@ implementation
         MaxMemPos:=$FFFF;
         MaxMemPos:=$FFFF;
       end;
       end;
 
 
+{*****************************************************************************
+                         TZXSpectrumIntelHexExeOutput
+*****************************************************************************}
+
+    constructor TZXSpectrumIntelHexExeOutput.create;
+      begin
+        inherited create;
+        { The ZX Spectrum RTL switches to interrupt mode 2, and install an
+          interrupt handler + table, starting at address $FDFD, so we must limit
+          program size to $FDFC }
+        MaxMemPos:=$FDFC;
+      end;
+
 {*****************************************************************************
 {*****************************************************************************
                                   Initialize
                                   Initialize
 *****************************************************************************}
 *****************************************************************************}

+ 1 - 1
compiler/systems/t_zxspectrum.pas

@@ -392,7 +392,7 @@ constructor TInternalLinkerZXSpectrum.create;
   begin
   begin
     inherited create;
     inherited create;
     CArObjectReader:=TArObjectReader;
     CArObjectReader:=TArObjectReader;
-    CExeOutput:=TIntelHexExeOutput;
+    CExeOutput:=TZXSpectrumIntelHexExeOutput;
     CObjInput:=TRelObjInput;
     CObjInput:=TRelObjInput;
     if ImageBaseSetExplicity then
     if ImageBaseSetExplicity then
       FOrigin:=ImageBase
       FOrigin:=ImageBase