Recent

Author Topic: <16 bit platforms.  (Read 2741 times)

Flamore

  • New member
  • *
  • Posts: 6
<16 bit platforms.
« 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!  :)

Handoko

  • Hero Member
  • *****
  • Posts: 3902
  • My goal: build my own game engine using Lazarus
Re: <16 bit platforms.
« Reply #1 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

winni

  • Hero Member
  • *****
  • Posts: 1992
Re: <16 bit platforms.
« Reply #2 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


Winni

Flamore

  • New member
  • *
  • Posts: 6
Re: <16 bit platforms.
« Reply #3 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?)
« Last Edit: October 08, 2020, 09:06:23 pm by Flamore »

sstvmaster

  • Full Member
  • ***
  • Posts: 175
Re: <16 bit platforms.
« Reply #4 on: October 08, 2020, 11:20:55 pm »
Windows 10 (64 bit)
Lazarus: 2.0.10 / Trunk x32

PascalDragon

  • Hero Member
  • *****
  • Posts: 2405
  • Compiler Developer
Re: <16 bit platforms.
« Reply #5 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.

Flamore

  • New member
  • *
  • Posts: 6
Re: <16 bit platforms.
« Reply #6 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.  %)


lucamar

  • Hero Member
  • *****
  • Posts: 3186
Re: <16 bit platforms.
« Reply #7 on: October 09, 2020, 12:52:29 pm »
Sounds a lot easier than I thought.

Wait until you start actually doing it ... ;D
Turbo Pascal 3 CP/M - Amstrad PCW 8256 (512 KB !!!) :P
Lazarus/FPC 2.0.8/3.0.4 & 2.0.10/3.2.0 - 32/64 bits on:
(K|L|X)Ubuntu 12..18, Windows XP, 7, 10 and various DOSes.

Thaddy

  • Hero Member
  • *****
  • Posts: 10571
Re: <16 bit platforms.
« Reply #8 on: October 09, 2020, 03:07:56 pm »
C64 is 6510, not 6502. Although they are closely related.

Edson

  • Hero Member
  • *****
  • Posts: 1111
Re: <16 bit platforms.
« Reply #9 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.

Lazarus 2.0.10 - FPC 3.2.0 - x86_64-win64 on Windows 8

 

TinyPortal © 2005-2018