bugbiter Posted January 26, 2015 Share Posted January 26, 2015 Is there a compiler for C for 6502 / A8? It would be fun and would help me code more in C :-) Quote Link to comment Share on other sites More sharing options...
tschak909 Posted January 26, 2015 Share Posted January 26, 2015 The end all be all 6502 C compiler, is CC65: http://www.cc65.org/ Every major target supported, tons of features, modern C ideas, fast compiler, and then some. -Thom Quote Link to comment Share on other sites More sharing options...
The Usotsuki Posted January 26, 2015 Share Posted January 26, 2015 And it originated as an A8 compiler. xD Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted January 27, 2015 Share Posted January 27, 2015 I have one called Ace C Compiler. It's on 5.25" floppy right now, but I may be able to ATR it tonight or tomorrow. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted January 27, 2015 Share Posted January 27, 2015 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. Quote Link to comment Share on other sites More sharing options...
Chilly Willy Posted January 27, 2015 Share Posted January 27, 2015 I had a Small-C compiler for the Atari called Deep Blue C. These days, it's just easier/faster to use a cross-compiler like CC65. Quote Link to comment Share on other sites More sharing options...
bugbiter Posted January 27, 2015 Author Share Posted January 27, 2015 I think it would be fun typing C code on my old Atari800 and seeing it on the familiar blue screen. Quote Link to comment Share on other sites More sharing options...
Island2Live Posted January 27, 2015 Share Posted January 27, 2015 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) Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 28, 2015 Share Posted January 28, 2015 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. Quote Link to comment Share on other sites More sharing options...
ricortes Posted January 28, 2015 Share Posted January 28, 2015 (edited) *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 January 28, 2015 by ricortes 1 Quote Link to comment Share on other sites More sharing options...
bugbiter Posted January 28, 2015 Author Share Posted January 28, 2015 No curly braces on the Atari - heavens, I hadn't thought about that! Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 28, 2015 Share Posted January 28, 2015 IIRC, many compilers replaced the curly braces with $( and $). It wasn't too big a deal. Quote Link to comment Share on other sites More sharing options...
Synthpopalooza Posted January 29, 2015 Share Posted January 29, 2015 flash: I think that's how Ace C did it on my Atari, not sure tho. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 29, 2015 Share Posted January 29, 2015 I think you're right. I used DBC, ACE C and CC65 and don't recall any of them using a different combo for the braces. Quote Link to comment Share on other sites More sharing options...
+MrFish Posted January 29, 2015 Share Posted January 29, 2015 (edited) 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 January 29, 2015 by MrFish Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted January 29, 2015 Share Posted January 29, 2015 An editor with a wide display and expanding tabs is really needed. I started one but never finished it. Medit does them but it's a bit quirky. You'd save half a dozen bytes per tab this way. Quote Link to comment Share on other sites More sharing options...
luckybuck Posted March 8, 2015 Share Posted March 8, 2015 All compilers can be found here: https://atariwiki.org/wiki/Wiki.jsp?page=C Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.