Jump to content
IGNORED

SDCC PIC16 C compiler?


zezba9000

Recommended Posts

CP1600 support is still in the plans.

 

I personally never abandoned C as my original goal was to get C# working not C for CP1600. All for a C compiler but C is just portable assembly for me.

 

Because of the conversations with @intvnut and looking into all the issues people have with re-targeting C to run on a custom 16bit CPUs made with FPGAs or the CP1600 I think a new lang will solve portability issues across Intellivision, Atari 8-bit, Nintendo, etc and be useful on modern PCs as well.

 

This new lang will be called "Ez" and you will get the same performance (if not better) as you would with C.

 

So ... is it a new language or is it C?

Link to comment
Share on other sites

OK. So your actual response to artrag is that you have given up on a C compiler for the Intellivision and will focus instead in a C-ish language.

Well not really as I never had a C focus @intvnut did. I just wanted to use C as a target assembler for a different lang to output to and so was just helping investigate C as I could make use of it as a portable assembly lang.

Link to comment
Share on other sites

I do not see how a new language will guarantee portability, C was interesting just for this reason. It allows to reuse millions of algorithms and lines of code on the net, but it is your project so do not care about me.

If C is wanted seems like making a new simple one might be a solution. One thats built with a plugin system for making it easy to re-target. C for me personally is only useful as a portable assembly as its just not good for the majority of my projects and or work.

Edited by zezba9000
Link to comment
Share on other sites

I kind of like the idea of a new language that borrows some of the best constructs from other languages, and supposedly can use existing compilers for partial code generation. It will require people to think when they try to implement old code, just like I posted earlier in this thread why I have reservations of a C compiler for a target which may have built in restrictions (and was questioned for my standpoint).

Link to comment
Share on other sites

I kind of like the idea of a new language that borrows some of the best constructs from other languages, and supposedly can use existing compilers for partial code generation. It will require people to think when they try to implement old code, just like I posted earlier in this thread why I have reservations of a C compiler for a target which may have built in restrictions (and was questioned for my standpoint).

I can post some of the initial syntax concepts thus far if interested later today after work. Keep in mind some syntax stuff may change.

Edited by zezba9000
Link to comment
Share on other sites

  • 2 months later...

 

My GCC port is based on GCC 7.2, so it's reasonably fresh. I doubt many of the enhancements in 8.x and 9.x will benefit the Intellivision greatly. If someone with serious dev chops wants to help me get a baseline release over the line, I can check in what I have and arrange for SVN access. Perhaps having a second set of eyes on the project would help draw some of my focus to getting it done. I know having Steve Orth on LTO Flash! was a huge help getting that over the line and shipped.

 

I would love to have a C compiler for the Intellivision, but I only have so many hours in the day, and I keep letting myself get distracted. :-P

 

I would love a C compiler, too, and I'd be happy to help, although I don't know if my chops are "serious" when it comes to compilers. I took one semester on compilers way back in college, but more recently when I looked into writing an LLVM backend, I got intimidated and gave up.

 

Do you still need a program to convert ELF to bin+cfg? I could probably do that. Do you have an example ELF file produced by your binutils port that I could look at?

  • Like 1
Link to comment
Share on other sites

 

I would love a C compiler, too, and I'd be happy to help, although I don't know if my chops are "serious" when it comes to compilers. I took one semester on compilers way back in college, but more recently when I looked into writing an LLVM backend, I got intimidated and gave up.

 

Do you still need a program to convert ELF to bin+cfg? I could probably do that. Do you have an example ELF file produced by your binutils port that I could look at?

C would be awesome.

However just an alternative update I've been hard at work on: https://github.com/reignstudios/IL2X

Been making some good progress on getting C# => C89 super optimized. I now have the fastest .NET runtime. I get even faster performance results than C++ using modern compilers for some stuff.

Much of the work learned here will go into a project called CS2X more suited for compiling a C# subset into CP1610 assembly.

  • Like 1
Link to comment
Share on other sites

  • 4 weeks later...

Can't remember if this was mentioned but PCC might be portable enough: https://github.com/IanHarvey/pcc

 

I've tried compiling PCC a few times for its already-supported platforms. I never got it to produce anything but a coredump, across several versions. Clearly I'm Doing It Wrong™, but that really turned me off to PCC.

  • Like 1
Link to comment
Share on other sites

  • 1 month later...

Been doing some good work on my CS2X transpiler: https://github.com/reignstudios/CS2X

Here is a demo of C# => C89 => WASM: http://reign-studios.com/wasm/cs2x/ray-trace-benchmark/cs2x.html

 

After I get C89 complete I will later add a C# => "CPU agnostic Byte-Code" that will be designed to make it easy to target assembly langs such as the CP1610.

The byte-code will have a C# API to make it super easy for anyone to just take it and convert it to any assembly lang with minimal effort (that will be the goal).

When I get to that point it will be much easier to collaborate and get Intellivision support working is my thinking.

Edited by zezba9000
  • Like 1
Link to comment
Share on other sites

@intvnut LLVM IR supports any bit on integer types: https://llvm.org/docs/BitCodeFormat.html

Which means I can add support for LLVM directly and then we can do a backend for LLVM IR => CP1610 asm.

 

I will look more into this approach when I get into supporting a byte-code. This should allow for very optimized assembly.

Edited by zezba9000
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.
Note: Your post will require moderator approval before it will be visible.

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.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...