C/C++ discussion (Was: Support for AHCC)

C and PASCAL (or any other high-level languages) in here please

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

Dal
Administrator
Administrator
Posts: 4178
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

C/C++ discussion (Was: Support for AHCC)

Postby Dal » Mon Aug 01, 2011 6:03 pm

*Moderator notice* The author of this post refers to the various C libs made by Paradize. See the Paradize section of the forum.

Well if ever there was a good excuse to exercise my C coding, this would be it. Been a lazy web and .Net hack for too long now.
Mega"SST" 12, MegaSTE, STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's

User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4106
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: Support for AHCC

Postby nativ » Tue Aug 02, 2011 2:07 am

Hi,
Are there any recommended books for learning C / C++ ,etc that would be 'crosspurpose' useful with Pure C on the ST/Falcon?

Any Forth libraries?

cheers
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records

Dal
Administrator
Administrator
Posts: 4178
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

Re: Support for AHCC

Postby Dal » Tue Aug 02, 2011 10:47 am

C as a language is universal. I used a couple of very good books (that are amongst my stuff at my parents' house at the moment). One was a beginners book and then I read a more intermediate book. There are loads out there - I thumbed through a few at a bookshop until I found one that suited me from an approach perspective.

Essentially so long as you understand the main C command set (only about 20 keywords to learn), the structure of the language, syntax, how header files are used - then you can start programming on any platform. If/when you come to demand a high level of optimisation, then you need to know more about the compiler and linker but for beginner stuff, you just need to know how to compile stuff into an executable.

Libraries like the ones referenced in the original thread in the Paradize forum make programming common functionality a lot easier. You can call on a lot of clever routines without necessarily having to know how they work (although it is good practise to have a look at .h files before you include them - you can learn a lot this way).

*Moderator note* Slightly edited to refer to the original thread.
Mega"SST" 12, MegaSTE, STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's

User avatar
Desty
Atari God
Atari God
Posts: 1962
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: Support for AHCC

Postby Desty » Tue Aug 02, 2011 11:05 am

I'd suggest to stay away from C++ for now - that's a headwreck for another day, and I'm not sure if there are any straight C++ compilers for the ST? A few years ago I got a cross-compiling gcc running on a Linux box to build TOS/Mint programs for the Atari, and I seem to recall failing to get g++ to work.

With that in mind, as Dal said, C is rather universal (it's often called "portable assembly" :)) so any half-decent book will do. I started with the Coronado C tutorial on a floppy back in the 90s, along with "C for Dummies" which was a fun book but didn't cover much.
The all-time classic is the first one - K&R's "The C Programming Language". Ancient but good.

You'll get all the help you need on the ST/Falcon specific side of things here, so don't worry about that too much...
A good way to get some experience - between easy sample exercises and difficult open-ended projects - is to pick an existing program with available C source and improve it by fixing a bug or adding a new feature. And there's a lot of public domain ST software out there with published C source :)
tá'n poc ar buile!

User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4106
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: Support for AHCC

Postby nativ » Tue Aug 02, 2011 2:54 pm

hi,
thanks! checked ebay for books there are plenty on C for less than £5! I guess DSP based stuff is 'easier' in C?

cheers

/nativ
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12672
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Support for AHCC

Postby wongck » Tue Aug 02, 2011 2:56 pm

Desty wrote:The all-time classic is the first one - K&R's "The C Programming Language". Ancient but good.


That's the one I read from cover to cover back when I was in uni. After that when to the uni SUN computer and started to program a war game. :mrgreen:
Later moved the code over to an Apple ][ computer that I loan from a friend, using at my room.
Sad to say that the motivation was there (writing a game... yeah)... but never got to finish it... and the code was lost forever.

That was the only C book I read (uni was teaching Pascal then) and the other C books I had was used more as a reference only.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Desty
Atari God
Atari God
Posts: 1962
Joined: Thu Apr 01, 2004 2:36 pm
Location: 53 21N 6 18W
Contact:

Re: Support for AHCC

Postby Desty » Tue Aug 02, 2011 3:17 pm

wongck wrote:That's the one I read from cover to cover back when I was in uni. After that when to the uni SUN computer and started to program a war game. :mrgreen:
Later moved the code over to an Apple ][ computer that I loan from a friend, using at my room.
Sad to say that the motivation was there (writing a game... yeah)... but never got to finish it... and the code was lost forever.

How about starting the project again, on the Atari? :thumbs:
tá'n poc ar buile!

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12672
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Support for AHCC

Postby wongck » Tue Aug 02, 2011 3:28 pm

Desty wrote:How about starting the project again, on the Atari? :thumbs:


Ha ha.... now it is worst due to lack of time.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5080
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: C/C++ discussion (Was: Support for AHCC)

Postby simonsunnyboy » Tue Aug 02, 2011 3:31 pm

*Moderator note* Splitted the thread as this discussion has nothing to do with Paradize releases in particular.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5080
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

C/C++ discussion (Was: Support for AHCC)

Postby simonsunnyboy » Tue Aug 02, 2011 3:42 pm

Dal wrote:C as a language is universal. I used a couple of very good books (that are amongst my stuff at my parents' house at the moment). One was a beginners book and then I read a more intermediate book. There are loads out there - I thumbed through a few at a bookshop until I found one that suited me from an approach perspective.

Essentially so long as you understand the main C command set (only about 20 keywords to learn), the structure of the language, syntax, how header files are used - then you can start programming on any platform. If/when you come to demand a high level of optimisation, then you need to know more about the compiler and linker but for beginner stuff, you just need to know how to compile stuff into an executable.

Libraries like the ones referenced in the original thread in the Paradize forum make programming common functionality a lot easier. You can call on a lot of clever routines without necessarily having to know how they work (although it is good practise to have a look at .h files before you include them - you can learn a lot this way).



I fully agree. Learn C on one platform and learn it without relying on system specific stuffs such as GUIs or such. If you mastered that, you can code for almost any target.

I actually write those libs esp for reuse. I want to learn how to do a functionality and implement it in a way that I can later use it in other projects.
I can still improve them but if I need ready-to-use routines for something, I have them at hand.

Assembly language coders on the ST intend to reinvent the wheel. I suggest sacrificing a little bit of speed for having a much better reuse and a much faster implementation cycle. The Reservoir Gods actually did something very similar with their GODLIB.

The reason i don't use it is because I want to learn myself howto do things and implement them for myself atleast once.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
DrCoolZic
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2188
Joined: Mon Oct 03, 2005 7:03 pm
Location: France
Contact:

Re: C/C++ discussion (Was: Support for AHCC)

Postby DrCoolZic » Tue Aug 02, 2011 7:16 pm

I f you want to code in C on an Atari there is one book you must read ;) C-manship by Clayton Walnum

The Calamus version of the book was ported to Hypertext by Lonny Pursel
The Hypertext version has been converted to PDF by me :)
You can find it here http://info-coach.fr/atari/software/lan ... p-v1.0.pdf

Dal
Administrator
Administrator
Posts: 4178
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

Re: C/C++ discussion (Was: Support for AHCC)

Postby Dal » Tue Aug 02, 2011 9:54 pm

Good stuff - I'll have a little browse through that :)
Mega"SST" 12, MegaSTE, STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12672
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: C/C++ discussion (Was: Support for AHCC)

Postby wongck » Tue Aug 02, 2011 11:49 pm

SSB, sorry about the blah blah.

What I mean was that a general book on C is good enough for a person to do programming.
In fact reading a general book like K&R will not cloud you with system specific (MS Windows API nor GEM API) so that the foundation on C itself is good.
The general book will make use of standard libraries - like stdlib, stdio etc which is available on ALL systems... Atari, Linux & Windows.
When I wrote that I did a partial program on SUN system and then moved it to Apple ][, it was moving from a Mini to a desktop micro computer.
My Stuff: FB/Falcon CT63 CTPCI ATI RTL8139 USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2428
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: C/C++ discussion (Was: Support for AHCC)

Postby christos » Wed Aug 03, 2011 12:06 am

Just a note, g++ under mint works. You need a very fast with lots of RAM system though.
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5080
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: C/C++ discussion (Was: Support for AHCC)

Postby simonsunnyboy » Wed Aug 03, 2011 3:20 pm

wongck wrote:SSB, sorry about the blah blah.


No need to be sorry, I simply cleaned up the thread. I think it didn't do any harm.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee


Social Media

     

Return to “C / PASCAL etc.”

Who is online

Users browsing this forum: No registered users and 3 guests