[fpc-devel] FPC and Z80

Florian Klaempfl florian at freepascal.org
Mon Apr 27 16:15:22 CEST 2020


Am 27.04.2020 um 15:37 schrieb nickysn--- via fpc-devel:
> On Mon, 2020-04-20 at 17:07 +0300, nickysn at gmail.com wrote:
>> On Thu, 2020-04-16 at 11:04 +0200, Guillermo wrote:
>>> Thanks Swen.
>>>
>>> I see last commit was 2 days ago so it is active.  I would like to
>>> know
>>> who is responsible to speak to him. May be I can help with the MSX
>>> target, but I need gidance about the internals of the compiler (I
>>> tried
>>> but it is beyond my comprehension right now).
>>
>>
>> The current state of the Z80 port is that it's partially working, but
>> it's not complete enough in order to be able to compile a full RTL.
>> However, simple stuff like this is working on the ZX Spectrum:
>>
>> program hello;
>> var
>>    i: byte;
>> begin
>>    PrintChar('F');
>>    PrintChar('P');
>>    PrintChar('C');
>>    for b := 0 to 255 do
>>      PrintHexByte(b);
>> end.
> 
> Last night, I got the full system unit to compile, including console
> output, so now you can use standard write/writeln. Unfortunately if you
> include both read/readln and write/writeln in your program, the program
> becomes too big to fit in the memory of the 48k ZX Spectrum, so there's
> lots of optimizations left to do... :) 

Maybe you look in the rtl for the CPUAVR defines. Reducing e.g. the size 
of textrec helps a lot, also exception handling for io (not sure if it 
is activated) causes a big share of code being pulled in.


More information about the fpc-devel mailing list