6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Apr 19, 2024 3:28 am

All times are UTC




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Jan 19, 2004 1:35 pm 
Offline

Joined: Fri Dec 19, 2003 10:57 am
Posts: 24
Location: Toulouse
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


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 19, 2004 8:20 pm 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 280
Location: Northern California
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

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Jan 19, 2004 8:33 pm 
Offline

Joined: Tue Nov 18, 2003 8:41 pm
Posts: 250
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 20, 2004 2:12 pm 
Offline

Joined: Fri Dec 19, 2003 10:57 am
Posts: 24
Location: Toulouse
Quote:


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/oric/coding/annexe_3/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:
#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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 20, 2004 2:25 pm 
Offline

Joined: Fri Dec 19, 2003 10:57 am
Posts: 24
Location: Toulouse
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jan 20, 2004 3:04 pm 
Offline

Joined: Fri Dec 19, 2003 10:57 am
Posts: 24
Location: Toulouse
Quote:


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


Top
 Profile  
Reply with quote  
 Post subject: WDC & Small Orders
PostPosted: Wed Jan 21, 2004 12:09 am 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 280
Location: Northern California
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

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 21, 2004 7:19 am 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
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"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Feb 03, 2004 12:31 am 
Offline

Joined: Sun Sep 15, 2002 10:42 pm
Posts: 214
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


Top
 Profile  
Reply with quote  
 Post subject: LCC816
PostPosted: Wed Feb 04, 2004 6:26 am 
Offline
Site Admin
User avatar

Joined: Fri Aug 30, 2002 1:08 am
Posts: 280
Location: Northern California
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

_________________
- Mike Naberezny (mike@naberezny.com) http://6502.org


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Feb 04, 2004 10:58 am 
Offline

Joined: Fri Dec 19, 2003 10:57 am
Posts: 24
Location: Toulouse
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 11, 2008 1:31 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
Hi Fabrice
any chance of a look at your lcc65 with '802 backend? Even if not finished!
Cheers
Ed


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Dec 11, 2008 2:23 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1678
Location: Sacramento, CA
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


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 08, 2010 10:02 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10789
Location: England
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun Aug 08, 2010 3:14 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: