Jump to content

NutStudio C compiler available for early users


Recommended Posts

My 6502 C compiler tool chain as an early release. Send a private request to me for details on how to download it if you are interested. 
Documentation is available here: https://drive.google.com/file/d/1Eai87NQhPZ_XoTtgwmo-g_Upk0xDAyx0/view?usp=sharing

I have installers for macOS, Arch and Debian Linux (x86_64).

Highlights:

  • ISO C 99 compiler for 6502/65C02. This is a freestanding implementation with many features you will typically find in a hosted compiler.
  • Fully reentrant code model.
  • Support for all integer types up to 64 bits 'long long'.
  • Floating point supported (32 bits IEEE-754).
  • Full support for struct, union, typedef and what you expect to find in C.
  • The C stack is located outside the zero page, which means it can be as large as available memory (in the full 64K address range).
  • Support for (stack allocated) variable sized arrays.
  • Run-time model based on using pseudo registers in the zero page.
  • Parameter passing uses A and pseudo zero page registers (up to 8  bytes). Any remaining arguments are passed on the stack.
  • The compiler utilizes zero page as much as possible for local and  temporary variables.
  • Optimizing compiler that can output source level debugging information.
  • Source code debugger included.
  • Support for ELF/DWARF, hex output as well as RAW and PRG (Commodore) style program files.
  • Like 3
  • Thanks 1
Link to comment
Share on other sites

WOOT!

I am so incredibly glad to see progress on the C front for 6502 after so (SO) many years of people (who don't understand zero page speed) saying "the 6502 just isn't suited for C".

I mean, I appreciate all of the work that went into cc65, but even its developers say that its stack handling is inefficient.

Not to take anything at all away from your project, but I also just recently found out about KickC, which outputs commented assembler for KickAssembler, which is a fairly reasonable way to start at high level code and then be able to dig down into assembly for critical path stuff without getting lost.

My ultimate hope is that everybody can look at what the other projects are doing, and that the entire ecosystem will be better for it.  I don't want one compiler to "win" or for all compilers to end up being exactly the same, I just know that different perspectives always provide more paths around obstacles, and going from one (mostly stalled) C compiler to three compilers, two of which are actively evolving, makes me very happy!

(I was so desperate at one point that I even considered using the period C compilers running on the machine, but that is incredibly painful)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

Please review our Terms of Use