[fpc-devel] FPC and Z80

nickysn at gmail.com nickysn at gmail.com
Mon Apr 27 15:37:33 CEST 2020


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... :) However, the fact that the
system unit compiles fully, means that the code generator is starting
to become stable and, therefore, you should have little trouble porting
FPC to other Z80 platforms, such as the MSX - it's a matter of writing
the platform-specific RTL functions, and implementing the specific
things (linking and postprocessing the binary), required to produce a
program, in a format, suitable to run on the MSX.

Nikolay



More information about the fpc-devel mailing list