Beginners cc65

Programming the 6502 microprocessor and its relatives in assembly and other languages.
User avatar
Dajgoro
Posts: 808
Joined: 08 Aug 2011
Location: Croatia
Contact:

Beginners cc65

Post by Dajgoro »

I am trying to figure out how the cc65 works. I use Windows and I am kinda lost with the cc65, i tried to compile a simple C code, but i get some error about network path not found. After reading the cc65 manual I am even more confused...
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Beginners cc65

Post by BigEd »

Are you running in a windows command shell or a Cygwin shell?
Sounds like a confusion between forward and backward slashes in file paths.
I recommend running in Cygwin.
Cheers
Ed
User avatar
Dajgoro
Posts: 808
Joined: 08 Aug 2011
Location: Croatia
Contact:

Re: Beginners cc65

Post by Dajgoro »

I have Cygwin, i had to use it once for some labs that i had to do...

But if i use Cygwin, then what are toes exe files?
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Beginners cc65

Post by BigEd »

Cygwin will run a win32 exe no problem. And Cygwin programs are also .exe files. But it does look like the cc65 binaries are for native windows. Perhaps you could paste your command line and the result?
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: Beginners cc65

Post by 8BIT »

I run CC65 from Windows XP and I don't use cygwin (although I'm sure its possible).

CC65 is not an easy "beast" to understand. First thing you need to decide is which platform you plan to target. Without that, it won't work. It is best to use a DOS batch file to handle the compiling process.

If you want an example, you can download my SBC-3 support package. It contains the source code to create an SBC-3 platform that you can target along with two sample programs. There is a batch file in each of the two demo programs that takes care of the compiling. Remember though, that this can only be executed from my SBC-3 (properly outfitted). There are many other targets included in the CC65 package so you will have to choose an appropriate one for your use.

It took me several months to build the target source files and to get programs to compile correctly. I started out by downloading Chris Ward's source files for retargeting CC65 to his SBC. From there, I just modifying those files to fit the SBC-3. I then went into the source files for other targeted platforms and started bringing in more routines that the SBC-3 would support, including serial, graphics, disk strorage, and ethernet.

It was a long road with many bumps, but it can be done.

Daryl

http://sbc.rictor.org/download/cc65lib.zip
User avatar
Dajgoro
Posts: 808
Joined: 08 Aug 2011
Location: Croatia
Contact:

Re: Beginners cc65

Post by Dajgoro »

First thing i need to figure out how to compile for any platform at all, is there a good free emulator for any of the cc65 platforms, so i can test the compiled program there, before i go and modify it to fit my sbc?
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Beginners cc65

Post by BigEd »

VICE emulates the C64 and is well thought of.
User avatar
Dajgoro
Posts: 808
Joined: 08 Aug 2011
Location: Croatia
Contact:

Re: Beginners cc65

Post by Dajgoro »

Yes but C64 emulators tend not to be free, and they are usually closed, so i don't know how i could manipulate the rom...
User avatar
BigEd
Posts: 11464
Joined: 11 Dec 2008
Location: England
Contact:

Re: Beginners cc65

Post by BigEd »

VICE is GPL. You're unlikely to find an historical system with open-sourced ROMs. You will find sources from reverse-engineering efforts for most of them.

(Normally you'd be compiling an application - whether the OS is open or closed isn't an issue.)
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: Beginners cc65

Post by 8BIT »

It would not be too hard to target the Kawalski Simulator, since all it has is simple input and output. That would at least give you something to start with. Purhaps I'll work on that. It may take a little time, as my spare time has been pretty sparse.

Daryl
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: Beginners cc65

Post by 8BIT »

I have completed the port to the Kawalski Simulator.

There are not too many features to port as the simulator only has a simple console window and no other IO.

I have also modified 4 of the sample programs to work with the limited conio.h routines. This should give a decent starting point for others to probe the workings of a generic cc65 target.

I just need to write up an brief instruction on installing cc65 with this target, along with generating and loading the samples.

Daryl
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Beginners cc65

Post by fachat »

Have you submitted the port back to the cc65 community? They might be interested.
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: Beginners cc65

Post by 8BIT »

Not yet. I think I would have to spend a lot more time testing more of the cc65 environment before doing that. The 4 demo programs run fine, but that is not to say that any generic C program will. I am not an expert in C. I was just driven enough get cc65 to work for my uIP ethernet project.

In other words, it's enough to help others get started but not a complete solution.

Daryl
Last edited by 8BIT on Fri Jun 08, 2012 10:20 pm, edited 1 time in total.
User avatar
GARTHWILSON
Forum Moderator
Posts: 8773
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Beginners cc65

Post by GARTHWILSON »

Quote:
I was just driven enough get cc65 to work for my uIP ehternet project.
Daryl, on the "Homebuilt Projects" page, Adam's uIP link (near the bottom) no longer really has anything to do with uIP. I was trying to find the correct link to give to Mike, and the closest I came was that it might be part of a 1.4GB (not MB!) download that I wasn't about to do. Do you have a link to the uIP material?
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
User avatar
8BIT
Posts: 1787
Joined: 30 Aug 2002
Location: Sacramento, CA
Contact:

Re: Beginners cc65

Post by 8BIT »

There used to be a link to the "old uIP" pages but they have removed that I see. Try a google search for uIP 1.0 or better yet, uIP 0.9. If that doesn't yield anything, I have the source files backed up at home and can email them to anyone who wants them.

Daryl
Post Reply