Jump to content
IGNORED

C compiler for a 6502?


Recommended Posts

Yes, to be clear, CC65 as it is now is a cross-compiler, meaning it runs on Windows or Linux ( and Mac I think ) and produces code that can be directly run on the Atari. It is very, very good. It originated from an A8 native compiler of the same name, which is still available, although I don't have a link. That version is cumbersome and limited.

Link to comment
Share on other sites

Believe me: It's not. Back in those days I had the »C/65« compiler from OSS ... but since our loved Atari simply lacks the curly brackets { } - which is most important for C-code - it was far from being fun hacking code.

 

C also gains it's readability from indents - tabs or spaces - into the code. The compiler does not need it but the code can get unreadable very fast if your not using that. And with a maximum of 40 characters in a line ... welll ... ;)

 

Beside that modern C-compilers follow the ANSI-standardization. Which means you do not only have the compiler itself but you also have a standard library with many many useful functions at hand ... for example the most important printf(). I am not sure but as far as I recall the C/65 was not compliant to any ANSI standard.

 

And last: The C/65 translates into assembler and not into a direct executable. The compile process was very time consuming and very disc swapping intensive as far as I recall.

 

If you are a programmer and know C ... go on ... it might be fun. But if you are willing to learn C, be yourself your best friend and start with cc65 on PC. ;)

 

Kind regards,

Henrik (Island2Live)

Link to comment
Share on other sites

I used the original CC65 compiler exclusively for a few years on a 130XE with an XF551 and SpartaDOS X. The compiler was huge (around 40KB) and compile times were extremely slow (and exacerbated by the fact SDX didn't use the mini buffers when the cart was disabled). But I had a complete environment on a single 360KB floppy (TextPro, compiler, assembler, linker, library and project source). I think I had a batch file which copied the library to the RAM disk to speed up the linker. I also rewrote the entire library in assembler to roughly conform to the old Borland C library (getfirst, getnext, etc). This made executables pretty small and meant I could type in Borland C DOS utilities with few amendments. I longed to rebuild the compiler itself using the faster, smaller IO library but I could never wrap my head around that at the time (compiling such a huge application on the A8 seemed almost unthinkable). Lots of fun, though, if you had the patience, and I still miss developing right on the A8.

Link to comment
Share on other sites

*IF* you don't mind an integrated envirionment, give Lightspeed C a look.

 

It was tightly written around its own DOS. The DOS can be distributed with your program or you can compile them to run under one of the other DOS available.

 

It has probably been 25 years since I last used it and I may have some of its features confused with other C compilers. That being said, almost all compilers on an Atari have to use a different escape sequence because the Atari doesn't have the brace symbols {}. Typically they use $( and )$ to replace the brace. That is an advantage of using a cross compiler on Intel platform. Except as I recall, Speed Script allowed you to use the brace character with an extra key depressed, something like <CONTROL>[. I'm pretty sure you can take the output from the Speed Script files and compile them under Lightspeed. This of course eliminates the use of the built in C editor except I think you can load and debug the Speed Script files. It's all about the brace character is our Atari's clear screen code 125.

 

I didn't like being somewhat forced into using Light Speed DOS, with time I have warmed up to the concept. I mean C is all about console and I/O so it makes sense to have any language take direct advantage of any canned routines in the DOS rather then duplcating them in the Runtime.

 

I think it also produced MAC/65 compatible .asm files if you wanted to keep them. This gave it the advantage of helping you learn asm language programming and the ability to use the Mac/65 library of source code.

 

I think this is a good link, on a Linux box so I can't check.

http://www.ftp.pigwa.net/stuff/collections/nir_dary_cds/Programming%20Utils%20Atari/C/Light%20Speed%20C/

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

C also gains it's readability from indents - tabs or spaces - into the code. The compiler does not need it but the code can get unreadable very fast if your not using that. And with a maximum of 40 characters in a line ... welll ... ;)

 

The Last Word's soft 80-column display works well for editing code. I haven't edited any C using it, but I have edited plenty of TBXL in which I use a lot of indentation. I probably wouldn't use the longer variable names that I'm accustomed to using when cross-developing; But that's not so much of a hindrance.

Edited by MrFish
Link to comment
Share on other sites

  • 1 month later...

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...