WDC "financial support" for a freeware C compiler

Programming the 6502 microprocessor and its relatives in assembly and other languages.
Euphoric
Posts: 24
Joined: 19 Dec 2003
Location: Toulouse
Contact:

WDC "financial support" for a freeware C compiler

Post by Euphoric »

I haven't found any freeware C compiler for the 65816, and there does not seem to be a lot of commercial C compiler for this target too (Avocet's ADC 2500AD C Compiler seems to be the only one, am I right ?).

[ad. mode on]
So I'm currently finishing one along the lines of my previous lcc65 compiler, and it rocks ! Strangely, lcc65 is not well known among 6502 users, despite the fact it generates better code than cc65, and correctly handle floats and integers (this is not true with cc65). Maybe this is because I wrote it for the Oric platform, which is less known than Ataris and Commodore platform, so it lacks libraries for non-Oric platforms.
[ad. mode off]

Ok, so, here is my question, maybe Mike could forward it to WDC...
Wouldn't it be a plus for WDC to say there's at least one excellent freeware C compiler for their 65816 processor, supported by the 6502.org community ? Then, would they agree to support the development of this compiler, for example by providing some free processor or board samples to the community ? (I would love some 65802 parts :-) )

Fabrice
User avatar
Mike Naberezny
Site Admin
Posts: 296
Joined: 30 Aug 2002
Location: Northern California
Contact:

Re: WDC "financial support" for a freeware C compi

Post by Mike Naberezny »

Euphoric wrote:
Ok, so, here is my question, maybe Mike could forward it to WDC...
Wouldn't it be a plus for WDC to say there's at least one excellent freeware C compiler for their 65816 processor, supported by the 6502.org community ? Then, would they agree to support the development of this compiler, for example by providing some free processor or board samples to the community ? (I would love some 65802 parts :-) )

Fabrice
Hi Fabrice,

First, I'll have to preface by saying that 6502.org has no real affiliation with WDC. We do have a relationship with them now, from ordering so many chips on the behalf of 6502.org visitors, however 6502.org remains a completely separate, non-profit entity. I managed to get better "distributor" pricing for us but our relationship with WDC is really as a customer.

I think that having a C compiler for the 65C816 is a great thing and I can offer to support it as much as possible through the 6502.org website.

I've asked on more than one occasion about the possibility of obtaining any 65C802 chips even though they are long out of production. Unforuntately, after repeated attempts I have to say that I do not think this is possible but I will probably ask again. I think the best plan for people seeking the 65C802 would be to participate in the adapter daughterboard design that's going on in the other thread.

Best Regards,
Mike
bogax
Posts: 250
Joined: 18 Nov 2003

Post by bogax »

http://sweetcherrie.com/jos/lcc.html

also mention of one here:

http://www.npsnet.com/danf/cbm/cross-development.html

under the name lcc816

(don't know if it's free,or even available)
Euphoric
Posts: 24
Joined: 19 Dec 2003
Location: Toulouse
Contact:

Post by Euphoric »

Excellent, these pages didn't appear when I tried a Google search.
Well, it's a good thing, at least there's some competition ;-)
I can see that the second page has a link to my first experiment with LCC backends (7 years ago ?), improving Ian Stephenson's 32 bit back-end for the 6502 ("a 6502 emulating a VAX").
A lot of water has flowed since : several years ago, I wrote a completely new LCC backend for the 6502, taking advantage of the 6502 addressing modes. This is what I call lcc65, an old version for the Oric is available here :
http://oric.free.fr/software.html

but the latest versions are now integrated in the OSDK (Oric Software Development Kit), that can be downloaded here :
http://www.defence-force.org/computing/ ... /index.htm

(you will also notice at the end of the first page, the presumably only one GCC for the 65C02 (yes, Gnu C)).

Ok, so, it seems it's time for some comparative review. Who wants to benchmark lcc65 .vs. cc65 .vs. gcc65 .vs. icc6502 (from IAR's embedded workbench) ? I would gladly do it, but I could be taxed of partiality (e.g exhibiting some cc65 bugs ;-) )
Ok, bugs and floats apart (lcc65 has support for floats, unlike most of the other compilers), benchmarks for the quality of code could be interesting (time and space issues). E.g: the simple eratosthene sieve benchmark

Code: Select all

#define SIZE 10000
char flags[SIZE];

main()
{
    int i, prime, k, count=0;
    for(i=0;i<size;i++)
        if (!flags[i]) {
            prime = i + i + 3;
            for (k=i+prime; k<size ; k+=prime) flags[k]=1;
            count++;
        }
    printf("\n%d primes :\n", count);
}
runs in 5.62" on the Oric platform when compiled with cc65 -O -Oir, and 4.89" when compiled with lcc65 -O3. Such black box benchmarks might not be enough for a precise comparative review, and not easy to run on the same platform. So, a deeper look at the generated assembly code could be necessary for a stronger review. Anyone interested ?

Cheers to all,

Fabrice

PS: here is an example of what my new 65802 generator is able to generate:
http://oric.free.fr/COMPILERS/test1.txt
Euphoric
Posts: 24
Joined: 19 Dec 2003
Location: Toulouse
Contact:

Post by Euphoric »

Quote:
First, I'll have to preface by saying that 6502.org has no real affiliation with WDC. We do have a relationship with them now, from ordering so many chips on the behalf of 6502.org visitors, however 6502.org remains a completely separate, non-profit entity. I managed to get better "distributor" pricing for us but our relationship with WDC is really as a customer.
I do know that, Mike, and Garth was telling me privately that WDC has some balanced judgement about the 6502.org community (part of it carrying an image of nostalgic users of an "old" chip, which is not always good for business).
Quote:
I've asked on more than one occasion about the possibility of obtaining any 65C802 chips even though they are long out of production. Unforuntately, after repeated attempts I have to say that I do not think this is possible but I will probably ask again. I think the best plan for people seeking the 65C802 would be to participate in the adapter daughterboard design that's going on in the other thread.
That's right. I'm eagerly waiting for a "mass production" of this module. I surely lack some patience, excuse-me for that :oops:

Cheers,

Fabrice
Euphoric
Posts: 24
Joined: 19 Dec 2003
Location: Toulouse
Contact:

Post by Euphoric »

and even two, with WDC's own one, which I discovered when parsing this list (I thought they only had one for the W65C02). It is advertized here:

http://www.westerndesigncenter.com/comp816s.html

Ok, so my initial question has no chance of being appreciated by WDC :-)
Sorry for having cluttered the forum...

Fabrice
User avatar
Mike Naberezny
Site Admin
Posts: 296
Joined: 30 Aug 2002
Location: Northern California
Contact:

WDC & Small Orders

Post by Mike Naberezny »

Euphoric wrote:
I do know that, Mike, and Garth was telling me privately that WDC has some balanced judgement about the 6502.org community (part of it carrying an image of nostalgic users of an "old" chip, which is not always good for business).
I think that I have developed a pretty fair relationship with them because I generally order a large number of parts and also buffer them from small orders.

However, you are right in the sense that, like most companies, they tend to shy away from hobbyists and small orders. Their reluctance to deal with small orders (and their minimum order restriction) is what prompted me to organize the bulk orders and then "distribute" the parts on an ongoing basis.

Back to the C topic, I think that a thorough review and comparison of the different C compiler options for both the '02 and '816 is a really good idea. I would be very interested in putting something like this on 6502.org if it could be organized.

Best Regards,
Mike
Nightmaretony
In Memoriam
Posts: 618
Joined: 27 Jun 2003
Location: Meadowbrook
Contact:

Post by Nightmaretony »

Now, if only someone can revampe Bytework's Orca C compiler which wads for the Apple ][ GS.... :)
"My biggest dream in life? Building black plywood Habitrails"
TMorita
Posts: 217
Joined: 15 Sep 2002

Post by TMorita »

bogax wrote:
http://sweetcherrie.com/jos/lcc.html

also mention of one here:

http://www.npsnet.com/danf/cbm/cross-development.html

under the name lcc816

(don't know if it's free,or even available)
I'm the one who did the lcc816 package.

I sent it to Mike to put up for download, but I didn't see it show up in the downloads section ... what happened to it Mike?

Toshi
User avatar
Mike Naberezny
Site Admin
Posts: 296
Joined: 30 Aug 2002
Location: Northern California
Contact:

LCC816

Post by Mike Naberezny »

TMorita wrote:
I sent it to Mike to put up for download, but I didn't see it show up in the downloads section ... what happened to it Mike?
Hi,

Sorry. I will get it up shortly.

Thanks,
Mike
Euphoric
Posts: 24
Joined: 19 Dec 2003
Location: Toulouse
Contact:

Post by Euphoric »

Quote:
PS: here is an example of what my new 65802 generator is able to generate:
http://oric.free.fr/COMPILERS/test1.txt
I've improved my 65802 generator again, it now uses the D register to implement "shifting registers" somewhat like the Sparc architecture...
Have a look at the small examples above, it's hard to do better... :-)
I will release it once I have improved the floating point handling...

Best regards,

Fabrice
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Post by BigEd »

Hi Fabrice
any chance of a look at your lcc65 with '802 backend? Even if not finished!
Cheers
Ed
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Post by 8BIT »

Wow. I had forgotten about this thread.

I would be interested in building a library for my SBC-3. I have downloaded the OSDK and will try to see what it will take. Any advice on where to start would be helpful.

thanks

Daryl
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: WDC "financial support" for a freeware C compi

Post by BigEd »

Euphoric wrote:
I haven't found any freeware C compiler for the 65816...
Fabrice
Ulrich Hecht recently made some optimisation improvements to the C compiler in his Snes SDK Toolchain (only targets the 65816)
kc5tja
Posts: 1706
Joined: 04 Jan 2003

Post by kc5tja »

I think that if lcc816 can be retargeted to use the ca65 and/or xa65 assemblers, it'll gain a much wider acceptance in the community. ca65, in particular, is an embedded coder's dream, as you can specify where things go by, basically, writing a text file with a memory map in it. I picked ca65 for my Kestrel environment after reviewing several other 65816 assemblers, judged on ease of use, syntax, etc.
Post Reply