Welcome, Guest. Please login or register.

Author Topic: Wanted: General info/courses on C/C++  (Read 3886 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline McVencoTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2006
  • Posts: 1428
    • Show only replies by McVenco
    • http://www.amigascene.nl
Wanted: General info/courses on C/C++
« on: October 27, 2006, 08:50:44 PM »
Today I received a bunch of developer tools which I'm planning to use mainly to learn a bit of programming, and maybe do something useful for the Amiga community in the future.

What I've got:
-StormC 2.0
-StormC 3.0 and Developer Survival Kit
-StormWizard 2.2
-p.OS-Prerelease
-Amiga Developer CD 1.1 and 2.1
-and 3 WarpUp stickers :-)

What I'm looking for:
-General info on programming in C on the Amiga

So far I only have the users manual, plus the knowledge that I can find tons of stuff on Aminet, but if anyone has some other hints of websites/sources on starter's programming I'd be grateful.

I'm also quite uncertain on what this p.OS Pre-release is. The name does ring a bell, but I can't put my finger to it...

Any help is welcome! (plus hints on what I should code first :-)
| A4000 | CS-MK3 060@50 | Picasso IV |
| Member of Team Amiga (tm) | FidoNet 2:286/414.18 (long ago) |
| SysOp The Missing Channel BBS | Member of AGA BBS Intl. |
 

Offline amiga_3k

  • Sr. Member
  • ****
  • Join Date: Apr 2006
  • Posts: 467
    • Show only replies by amiga_3k
    • http://www.elf8.nl
Re: Wanted: General info/courses on C/C++
« Reply #1 on: October 27, 2006, 09:06:04 PM »
The WarpUp stickers should make your Amigas fly :-)

As for p.OS-pre-release: It's a pre-release of p.OS (duh). It was a shot of  a German company (ProDad, I believe, too lazy to grab my copy of it from the cupboard to verify) to create a replacement OS for classic Amiga hardware. Until that moment, ProDad was known for some software-titles mainly for adding titles to video and do some rather nice video-swipes. p.OS never realy took off but somehow I did like it (the CD comes with a Chess game that even I could beat ;-)). Have a few hours of fun with it, you won't be too disapointed.

I have some experience in programming C on.... Windows (the boss made me do it!).... and had a go on it with the Amiga but decided to take the easy route again and stick with AmigaBASIC like ACE (for the moment).

If you've got the hang of C you could have a go at porting Firefox on Classic Amiga ;-)
Get a SAM, while you can! The new AMIGA is here!
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Wanted: General info/courses on C/C++
« Reply #2 on: October 27, 2006, 11:53:05 PM »
Look at the Rom Kernal Reference Manuals on the Amiga Developer CD 2.1.  They're the reference manuals everybody is supposed to use when programming Amigas.
 

Offline thedaemon

  • Jr. Member
  • **
  • Join Date: Aug 2006
  • Posts: 55
    • Show only replies by thedaemon
    • http://www.brandonayers.com
Re: Wanted: General info/courses on C/C++
« Reply #3 on: October 28, 2006, 03:37:58 AM »
Have you ever programmed at all? If you have a decent knowledge pick up "The C Programming Language" it basically tells you how to work with C. Then you should learn the amiga specifics after that.
 

Offline McVencoTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2006
  • Posts: 1428
    • Show only replies by McVenco
    • http://www.amigascene.nl
Re: Wanted: General info/courses on C/C++
« Reply #4 on: October 28, 2006, 10:00:40 AM »
I've programmed a very little bit in Basic, AMOS and assembler, but that's a long time ago.

The only thing related to programming that I've done the past years is a lot of php stuff. So I don't have much knowledge of programming, but when I look at some code, it's not gibberish at all. I can't just do it myself yet.

And I will most certainly have to take a look at the RKM's, I didn't know they were on the CD, so that's good news.
I also have a copy of "Amiga Intern 2.0", a German book (translated to Dutch) on coding, but that's pretty limited to WB1.3. I could be a good book for reference though..


And as for Firefox: maybe in 10 or 15 years if I start working on if fulltime from now on :lol:
| A4000 | CS-MK3 060@50 | Picasso IV |
| Member of Team Amiga (tm) | FidoNet 2:286/414.18 (long ago) |
| SysOp The Missing Channel BBS | Member of AGA BBS Intl. |
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Wanted: General info/courses on C/C++
« Reply #5 on: October 28, 2006, 11:12:19 AM »
My one main() piece of advice would be:

If you haven't done any coding outside of BASIC/asm, forget about learning to write AmigaOS specific C/C++ code at the outset.

Not entirely, of course but I strongly advise learning the syntax of the language in an OS neutral way. Sure, that means writing a few no-fun "should compile anywhere" CLI programs to start with, but once you've mastered the basic syntax, anything you see in C for amigaos will make vastly more sense than they would otherwise.

As you've already done some ASM, you have an excellent background to understand C. This may sound a strange remark, but C is not as high level as many people would have you believe, which is one reason it tends to produce fast object code. A lot of concepts understood from assembler apply. In particular, pointers, which are often a source of confusion for people new to C are much more readily grasped as a concept when you already know about addressing modes like (a0), (a0)+, -(a0), (a0,d0.l*4) etc.

Before you even look at amigaos specific coding, you should be fully comfortable with functions, pointers, pointer casts (totally evil but essential for dealing with a lot of OS resources) and structures.

As you have worked with PHP, at least the brace syntax should be OK, as should be the notion of functions. A lot of people with experience only in basic struggle with C's universal function syntax which does not have a syntactical distinction between 'subroutines' and 'procedures'. A function may take parameters and either returns a value (procedure), or it doesn't (subroutine).
int p; // A
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Wanted: General info/courses on C/C++
« Reply #6 on: October 29, 2006, 04:27:18 AM »
Quote

McVenco wrote:
I've programmed a very little bit in Basic, AMOS and assembler, but that's a long time ago.


What did you do in AMOS?  I'm curious becuase I'm a member of the Mattathias Basic project and we're trying to make Mattathias (son of Amos) function as an AMOS to C translator.

Quote

And I will most certainly have to take a look at the RKM's, I didn't know they were on the CD, so that's good news.
I also have a copy of "Amiga Intern 2.0", a German book (translated to Dutch) on coding, but that's pretty limited to WB1.3. I could be a good book for reference though..


I have that book in English.  It's pretty repetitive but it will get you started.  Just don't refer to it unless you are programming for AmigaOS 1.3. :lol:  The RKRMs on the Developer CD and the AmigaOS 3.1 and 3.5 NDK will be most of the references you need on the Amiga side of things.

The biggest problem you'll run into is that most Amiga software is written in ANSI C but most of the tutorials today are based on C++.  There may be functionality missing on Storm C++ since it preceeded the ratification of the ANSI standards of C++.

I don't use C++ unless I see a specific advantage to it since most of the stuff I do is either available in C or can be performed in object oriented code written in C (with a few function pointers here and there :-D ).

C++ is usually better when it comes to writing LARGE programs with interrelated parts.  C is better for writing system-specific code for Amiga's varargs functionality (not available under strict C++ syntax).
 

Offline dillinger

  • Jr. Member
  • **
  • Join Date: Apr 2005
  • Posts: 99
    • Show only replies by dillinger
Re: Wanted: General info/courses on C/C++
« Reply #7 on: October 29, 2006, 05:03:59 AM »
If you can find a copy, I recommend a book called Complete Amiga C. I can't remember the specifics of exactly what it covers but I remember it included general C topics (language construct, syntax, stdlib, etc) as well as topics specific to Amiga coding.

Quick Google search for details on the book has just thrown-up this thread btw: http://www.amiga.org/forums/showthread.php?t=25144

if you're lucky "Spudley" might still have his copy ;)

Also, Aminet has the famous Amiga C Manual: http://aminet.net/dev/c/ACM.lha . This is mainly an Amiga specific programming guide, so if you haven't learn C yet then it's probably not a good place to start. Also, it is based on v1.3 Amiga libs, so no 3+ specific info. But once you've grasped the general Amiga system library/API concepts you can simply read the latest Autodocs from the AmigaSDK for newer details.

hope it helps
My Sys Specs:-
A1200 Desktop^Blizzard 060 (Phase5) with mk-IV SCSI Kit (8.5ROM)^128MB 60ns RAM^Int. 30GB HD^Ext. SCSI DVD drive & 9GB SCSI HD^Int. DCE ScanDoubler/FF^ MicroVitec 1701 Msync monitor^PCMCIA LAN Linked^AmigaOS 3.9+BlizKick+PFS3
 

Offline jjans

  • Full Member
  • ***
  • Join Date: Aug 2003
  • Posts: 241
    • Show only replies by jjans
Re: Wanted: General info/courses on C/C++
« Reply #8 on: October 29, 2006, 05:08:40 AM »
I found the Amiga C Manual by Anders Bjerin quite helpfull available here: http://aminet.net/package/dev/c/ACM#contents
\\"Most Xenonites fly imports. Unfortunately yours is a domestic model. Don\\\'t be surprised if the gears work in reverse\\" - Volhaul\\\'s Revenge: Close Encounters of the Sludge Kind.

GVP A530, VXL 30/32, Supra 500XP, A590, A1000.
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Wanted: General info/courses on C/C++
« Reply #9 on: October 29, 2006, 05:47:20 AM »
 :-x I'd recommend against any book prior to AmigaOS 2.04 since a LOT has changed since then.  AmigaOS 3 has datatypes and memory pools but other than that it should be easy to pick up.  Kickstart 1.3 didn't have varargs functionality that is essential for AmigaOS 2-3 (but not necessary on 4).
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: Wanted: General info/courses on C/C++
« Reply #10 on: October 29, 2006, 10:52:54 AM »
Quote

SamuraiCrow wrote:

The biggest problem you'll run into is that most Amiga software is written in ANSI C but most of the tutorials today are based on C++.  There may be functionality missing on Storm C++ since it preceeded the ratification of the ANSI standards of C++.


If you get hold of StormC4, at least it's got a gcc 2.95.3 backend, so it tends to reasonably compile most stuff. However, it doesn't come with the C++ STL, though it is possible to kludge it in.

The main reason I'd reccommend StormC (any version) to a beginner is the IDE which really is very friendly (for more advanced projects it can rapidly become awkward, but by then you'll be on proper gcc/make ;-))

Quote

I don't use C++ unless I see a specific advantage to it since most of the stuff I do is either available in C or can be performed in object oriented code written in C (with a few function pointers here and there :-D ).


I've sort of gone past the point where I can stomach normal C code for most projects. I very rarely use it anymore, simply because the OOP paradigm is firmly entrenched in my noggin.

However, I agree you should use the right tools for the job. C is well suited for simple, OS native programs with not many source files.

The moment you find yourself making a lot of structures and functions to deal with them, you really ought to consider if C++ is the way to go.
int p; // A