From e41912b07644864a3a685ac339de2085d252706e Mon Sep 17 00:00:00 2001 From: nickysn Date: Mon, 22 Jun 2020 14:13:54 +0000 Subject: [PATCH] * 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 - --- compiler/ogrel.pas | 20 ++++++++++++++++++++ compiler/systems/t_zxspectrum.pas | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/compiler/ogrel.pas b/compiler/ogrel.pas index bc527f8104..fce7d07cf4 100644 --- a/compiler/ogrel.pas +++ b/compiler/ogrel.pas @@ -131,6 +131,13 @@ interface constructor create;override; end; + { TZXSpectrumIntelHexExeOutput } + + TZXSpectrumIntelHexExeOutput = class(TIntelHexExeOutput) + public + constructor create;override; + end; + implementation uses @@ -1321,6 +1328,19 @@ implementation MaxMemPos:=$FFFF; 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 *****************************************************************************} diff --git a/compiler/systems/t_zxspectrum.pas b/compiler/systems/t_zxspectrum.pas index 2bdb1484f5..6dfe48d3da 100644 --- a/compiler/systems/t_zxspectrum.pas +++ b/compiler/systems/t_zxspectrum.pas @@ -392,7 +392,7 @@ constructor TInternalLinkerZXSpectrum.create; begin inherited create; CArObjectReader:=TArObjectReader; - CExeOutput:=TIntelHexExeOutput; + CExeOutput:=TZXSpectrumIntelHexExeOutput; CObjInput:=TRelObjInput; if ImageBaseSetExplicity then FOrigin:=ImageBase