I don't think it could be good, GCC had never been made for 16bit and 8bit CPU.. It is bad on managing registers (it was top x86 centric) and the use of register on the 6502 is not really simple and standard, and as the 6502 have a really small stack, either we make a software stack (that use lot of memory, else:. Don't best too much function call or strange thing may happen :S

I'd love to have a decent C compiler on the Oric - maybe something that can really exploit the new-found power of Cumulus, perhaps, to give the Oric at least a decent way of building optimized apps in a language other than Basic, without requiring the investment into an archaic assembly language. That is to say, if we had a good C compiler *on* the Oric, assuming you have a Cumulus/disk-space, then we can at least continue to see the Oric as a way to learn a language that has some relevance here today .. C is still a great language to learn, and the limits of the Oric platform are precisely the realms that C was designed to conquer, in the first place. Putting a decent C compiler on the Oric would help fulfill that dream ..

ibisum wrote:I'd love to have a decent C compiler on the Oric - maybe something that can really exploit the new-found power of Cumulus, perhaps, to give the Oric at least a decent way of building optimized apps in a language other than Basic, without requiring the investment into an archaic assembly language. That is to say, if we had a good C compiler *on* the Oric, assuming you have a Cumulus/disk-space, then we can at least continue to see the Oric as a way to learn a language that has some relevance here today .. C is still a great language to learn, and the limits of the Oric platform are precisely the realms that C was designed to conquer, in the first place. Putting a decent C compiler on the Oric would help fulfill that dream ..

Calling indecent the C compiler we have at the moment is not really fair.

Sure it's not a record breaking performer, but it's pretty standard compliant, most code runs without any modification, it does not have any insane limitation either.

Well - correct me if I'm wrong, but aren't you talking about a Cross-compiler? I'm sure we can find tons of decent C compilers to cross-compile - but what I would find very productive for teaching my kids C is if they didn't need another machine to cross-compile, but could instead use the Oric itself ..

Anyway, I'm not complaining - just making a desire for the future. If the Cumulus Age can give us more onboard tools now we have near-infinite space available, then I think an onboard C compiler would be great.

A C compiler running on the oric is almost impossible to do, at least to have good conformance with the C standard. For example on TI 68k calculator the only C compiler existing take more than the 64K limit with a fairly poor C89 conformance and the 68000 inside is much powerful than the 6502 running the oric, and takes ages just to compile even simple applications..

Impossible is maybe I bit harsh, but running a c compiler without an OS have no meaning so we need sedoric or other DOS, a floppy drive and with such setup the memory is extremely limited..

CrossCompiling for he Oric and all 6502 based computer is almost the only way to go. The only C compiler running on a CPU of the 65cxx family was on the IIGS which have a 65c816 and the compiler have lost of limitation.. (And the 65c816 have access to larger memory space than the 6502)

If you really want your kids to practice C or over language on cheap/low power computer, you better search for a any 68000 computer or a beaglebone (black) a rPI or an Arduino (even if this one need a PC to cross compile)

We already have plenty of other toys to learn C programming on. I just wanted something that would work on the Oric.

And, imho, doesn't the Cumulus represent a near-infinite amount of expansion when it comes to compiling? We don't have to build a single-pass compiler - multiple passes, given the RAM limits, might work.

Anyway this is all blue-sky thinking, and I suppose I should put more energy into actually contributing something to this aspect of Oric life ..

ibisum wrote:We already have plenty of other toys to learn C programming on. I just wanted something that would work on the Oric.

And, imho, doesn't the Cumulus represent a near-infinite amount of expansion when it comes to compiling? We don't have to build a single-pass compiler - multiple passes, given the RAM limits, might work.

Anyway this is all blue-sky thinking, and I suppose I should put more energy into actually contributing something to this aspect of Oric life ..

You could try to port one of the existing C compilers on the Oric, using Cumulus and multi-pass as you said, or write your own.

Let's have a deal: If you can make a working C compiler that runs on the Oric and generate decent code, I promise to write an efficient text editor for it, complete with syntax coloring, shortcuts, and built-in documentation.

Dbug wrote:Let's have a deal: If you can make a working C compiler that runs on the Oric and generate decent code, I promise to write an efficient text editor for it, complete with syntax coloring, shortcuts, and built-in documentation.

Sorry for the Off topic, but wouldn't it be on top of the wishlist a new revision of Cumulus firmware? I *really* think a better software could help some people out there with Orics which seem not to be compatible with it...

Not trying to stop anyone's dreams (hey, I am the first one doing my own things, instead of helping with this) but thought it would be nice to remember this need...

Does someone tried to compile GCC 6502?
By me it failed. Yes, I know this forum is not the right place to report GCC 6502 bugs,
but I think it would be interesting to discuss the error - just like assembler puzzle .
The question is:
How can be replaced the expression in the C source, so the result remains correct and the compilation succeeded?

If I remember correctly, the 6502 version of GCC was based on an old version of GCC and didn't have all the bugs fully worked out.
The version of GCC used is now so old and GCC has changed so much that it would be difficult to port the 6502 code generator to the newer code tree.

iss wrote:For now I don't have any impressions of this new compiler,
but I'm really curious to run some checks.

Would be interesting to write a small test:

- Use the internal timer to get some accurate values, and then use it to time some routines, both with the old compiler and the new one
- Measure the size of the executable

Things easy to measure are for example:
- Loop in C to erase the screen or copy a picture
- Things like computing factorials or digits of pi
- Efficiency of complicated code with multiple loops, calling functions with parameters that themselves do stuff
- Recursion (limited)
- How it handles 8 bits and 16 bit values

Also, an important factor is how easy it is to integrate with an external assembler. GAS is a piece of turd, GCC inline assemble has been designed by retarded psychopaths and should not be used even under duress, so it's important to be able to mix and match with other assemblers