Lazarus

Miscellaneous => Suggestions => Topic started by: Flamore on October 08, 2020, 08:18:08 pm

Title: <16 bit platforms.
Post by: Flamore on October 08, 2020, 08:18:08 pm
It would be pretty nice to see Free Pascal compile to classic CPU's like the Z80 (8080 fork, 8086 (x86) was derived from 8080 too, so shouldn't be too hard to make it possible) and the 6502, just
 as examples of many 8-bit processors that exist. They have C compilers like the Z88DK and CC65 but there is no Pascal compiler yet. So here I am suggesting that FreePascal should be able to compile to 8-bit CPU's like the Z80, 6502 and maybe the ATMEL AVR to program Microcontrollers!

Peace!  :)
Title: Re: <16 bit platforms.
Post by: Handoko on October 08, 2020, 08:37:48 pm
Hello Flamore,
Welcome to the forum.

FPC can target 8086, Z80, AVR and others, read more:
https://wiki.lazarus.freepascal.org/Platform_list
Title: Re: <16 bit platforms.
Post by: winni on October 08, 2020, 08:57:24 pm
Hi!

Zilog 80180 in the german forum.

Work in progress.

https://www.lazarusforum.de/viewtopic.php?f=11&t=12987&p=115164&hilit=Z80#p115164 (https://www.lazarusforum.de/viewtopic.php?f=11&t=12987&p=115164&hilit=Z80#p115164)


Winni
Title: Re: <16 bit platforms.
Post by: Flamore on October 08, 2020, 09:03:09 pm
Hello Flamore,
Welcome to the forum.

FPC can target 8086, Z80, AVR and others, read more:
https://wiki.lazarus.freepascal.org/Platform_list

SHEESH!   :D
I must have not noticed it due to the fact that I only looked thr downloads page and suggested.
But what about the 6502 that could be used to make awesome demoscene entries? Is there a way I could somehow be able to contribute to the platform development? (Like by manually writing each Pascal word in assembly?)
Title: Re: <16 bit platforms.
Post by: sstvmaster on October 08, 2020, 11:20:55 pm
6502 by Edson: https://github.com/t-edson/P65Pas
Title: Re: <16 bit platforms.
Post by: PascalDragon on October 09, 2020, 09:30:19 am
But what about the 6502 that could be used to make awesome demoscene entries?

The 6502 is something that some of the devs would like to see come to life as well. :)

Is there a way I could somehow be able to contribute to the platform development? (Like by manually writing each Pascal word in assembly?)

Well, you could give it a try to simply implement it. Start by taking e.g. the Z80 backend copying it over to a 6502 directory and adjusting it piece by piece (okay, it's obviously not so simple, but one has to start somewhere, right ;) ). And at first you don't need to deal with internal assemblers and linkers and such, simply generate assembly files that can be picked up by some 6502 assembler and then let them link together by some 6502 capable linker.
Title: Re: <16 bit platforms.
Post by: Flamore on October 09, 2020, 10:45:35 am
Well, you could give it a try to simply implement it. Start by taking e.g. the Z80 backend copying it over to a 6502 directory and adjusting it piece by piece (okay, it's obviously not so simple, but one has to start somewhere, right ;) ). And at first you don't need to deal with internal assemblers and linkers and such, simply generate assembly files that can be picked up by some 6502 assembler and then let them link together by some 6502 capable linker.
Sounds a lot easier than I thought.
6502 by Edson: https://github.com/t-edson/P65Pas
It only supports the C64, and that's not really universal for 6502 platforms.  %)

Title: Re: <16 bit platforms.
Post by: lucamar on October 09, 2020, 12:52:29 pm
Sounds a lot easier than I thought.

Wait until you start actually doing it ... ;D
Title: Re: <16 bit platforms.
Post by: Thaddy on October 09, 2020, 03:07:56 pm
C64 is 6510, not 6502. Although they are closely related.
Title: Re: <16 bit platforms.
Post by: Edson on October 09, 2020, 05:07:14 pm
6502 by Edson: https://github.com/t-edson/P65Pas
It only supports the C64, and that's not really universal for 6502 platforms.  %)

Unlike other compilers, P65Pas is not only for C64. It's a quite agnostic platform 6502 compiler. The compiler doesn't know about where the devices are mapped in memory. You can define several RAM maps, using units like is done for the C64.

Currently I'm redesigning the P65Pas compiler to include support for the 65C02 CPU.

You can check too my compiler for 8-bits Microchip PIC microcontrollers: https://github.com/t-edson/PicPas. It targets to most of the the 10F, 12F and 16F series.

TinyPortal © 2005-2018