[HN Gopher] KickC is a C-compiler for 6502-based platforms creat...
___________________________________________________________________
KickC is a C-compiler for 6502-based platforms creating readable
assembler code
Author : muterad_murilax
Score : 38 points
Date : 2024-06-09 10:49 UTC (12 hours ago)
(HTM) web link (gitlab.com)
(TXT) w3m dump (gitlab.com)
| NonEUCitizen wrote:
| The README says:
|
| "KickC is currently in beta, and at times crash or creates ASM
| code that does not work properly."
| snvzz wrote:
| Sounds like your average compiler.
| omoikane wrote:
| It's also lacking support for 2D arrays, recursive functions,
| etc.:
|
| https://docs.google.com/document/d/1JE-Lt5apM-g4tZN3LS4TDbPK...
| pjmlp wrote:
| Given the 6502 limitations, performance with good comments is
| much more relevant.
|
| Otherwise, kudos for the effort.
| ruk_booze wrote:
| Heh, the repo comes with the cruncher plugins I once hacked up
| for Kick Assembler. Cool!
|
| https://gitlab.com/camelot/kickc/-/tree/master/repo/se/triad...
| ok123456 wrote:
| Is there a comparison against cc65?
| dzdt wrote:
| cc65 aims for full C language support, which kickC does not
| have, but cc65 code will never look like hand assembly which
| kickC often does.
| dzdt wrote:
| The 6502 is somewhat famously a hard target for the C language,
| and KickC does quite well at producing good results in spite of
| this. The C language is heavily based around pointers and stack
| usage. The 6502 has a minimal hardware stack: 256 bytes with no
| stack-relative addressing. So a "stack frame" is an alien concept
| that requires slow workarounds to emulate. And the 6502 only has
| pointers in the form of words stored in the first 256 bytes of
| RAM ("zero page") and also requires the use of one of the three
| registers to dereference.
| WalterBright wrote:
| The way to do it is to make a C-like language that has types
| and operators that map easily onto the 6502 architecture.
|
| After all, C was designed to map onto the PDP-11 architecture -
| things like postincrement.
___________________________________________________________________
(page generated 2024-06-09 23:01 UTC)