[net.micro.cbm] C64 compiler info

jow@unccvax.UUCP (Jim Wiley) (05/02/85)

Here is a list of responces to my request for a C compiler for the
Commodore 64...

----------------------------------------------------------------------

For the Commodore 64:

Abacus Software is advertising a "C-LANGUAGE COMPILER"-a full C language 
compiler. Conforms to Kernighan & Ritchie standard, but without bit fields.  
Package includes editor, compiler and linker.  $79.95
(616) 241-5510

----------------------------------------------------------------------

> I have a Commodore 64 and am looking for a C compiler for it.  If
> anyone out there has a C compiler I would like to hear from you.

Pro-Line's C compiler is now available.

> My basic questions follow not necessarily in order of importance.

> 1)  What sort of editor does it use?  Does it come with the compiler
> or do I need to get an editor too?

The package comes with a full-screen editor. It scrolls in four directions,
has cut and paste, search and search and replace, and other features.
Also included are a linker and a "shell" which supports command-line
arguments and I/O redirection.

> 2)  Does it come with an assembler?  If not what assembler are you
> using.  Can you compile down to the assembly level and stop there?

The compiler does not come with an assembler, nor does it compile to
assembler. It produces an intermediate code which is tranlsated to
machine code. However there is a library function which allows 
machine language subroutines to be called.

> 3)  Can you link modules together?  How does it handle files when
> linking?

The compiler produces an object file for each source file. Several object
files may be linked to create one executable file. The linker will
automatically link in all the library functions required.

> 4)  How much does it let you get away with?  For example, can you
> do the following:

> int	row,col,c;
> char	*ptr;
> ptr=1024;		/*  screen  */
> ptr[col][row]=c;

No, but try this:

#define WIDTH 40
#define SCREEN  ((char *) 1024)
#define plot(row, col, c)   SCREEN [ (col) + (row) * WIDTH ] = (c)

int row, col, c;
plot (row, col, c);

> 5)  Does it come with any utilities like printf, getchar, etc?  Does
> it have a math library for trig and other functions?  Does it use
> the kernel routines?  Does it handle floats?

Yes, yes, yes, and yes. The library contains about 80 functions.

> 6)  How much does it cost?  Who makes it? 

$100 U.S.  
Pro-Line Software, Mississauga, Ontario.    (416) 273-6350

> 8)  Are there any shortcomings or quirks I should know about before I
> buy?

Bit-fields are not implemented, and there are a few restrictions on
initializers (e.g. structs can't be initialized).

---------------------------------------------------------------------

Aside from Small-C running under CPM, the only C compiler I have
heard of for the C64 is soon to be released by a company called Abacus
Software.

They claim that it is a full Version 7 C, except no bit fields. The
package includes editor, compiler, linker, and debugger for $79.95.

I called them a while back and they said the compiler would be ready
in April.  Other products I have bought from them have been solid, though
not always spectacular performers.

---------------------------------------------------------------------

I called up ABACUS and they said that their c-complier would be out
in June and not April as they had originally said. I guess we will
have to wait some more.

---------------------------------------------------------------------

Why wait?  Get C Power by Brian Hilchie, available now from Pro-Line Software
of Mississauga, Ontario.  416-273-6350, or orders from USA 800-387-3208.
I've been using it for one day and it looks really ok.  Bit fields are not
implemented, big deal.  It comes with a shell which supports the commands
ls, rm, mv, pr (i.e. cat to screen), disk (i.e. send a string to the disk
device), cc, and link.  The shell also supports I/O redirection.  
CC produces a .o file which you can then link with whatever you like to produce
an executable, either standalone or callable from the shell.
There is not total equivalence of things declared pointer to char and array of
char.  I have found that you can't say
     char ch[MAXLEN];

     ch++;

which I believe should be legal C.  However if you declare
     char *ch2;

     ch2 = ch;
     ch2++;

the incrementation is allowed.

---------------------------------------------------------------------

Is there anyone, other than the author, that is running the
Pro-Line C compiler on their 64? If so, hows about a review?

A software dealer in my area will be getting a copy this week,
so if nobody has replied by then. I will post a mini-review
after I have played with his copy a bit.

P.S. I talked to Pro-Line this morning. You can purchase the product
from them for $99.99. They accept Visa, MC, and Amex. You can also
contact their US distributor, Micro Pace, at 217-356-1885 to find
out the dealer in your area. They will also sell it to you direct if
there isn't a dealer in your area.

-----------------------------------------------------------------------

This is just a quickie mention (hardly a review - no time) of the
Pro-Line C compiler.  I just got mine in the mail on Wednesday, and
so far, I would say it's just short of outstanding.  Take that with a
grain of salt, however.  I'm a rank beginner at C.  

The "environment" includes a "shell" which supports familiar disk
commands like ls, rm, mv and does i/o redirection (output only?).
Command line arguments are passed in the familiar way (argc, argv).
Programs are compiled with "cc" and then linked with an interactive
linker.  The compiler lists the program as it compiles, stopping on
each error encountered.  The linker prompts (>) for object filenames.
Typing an up-arrow includes all system library stuff and a null entry
signals that you think you're done.  A really nice feature of the linker
is that if you omit an object module, it will display all unresolved
external references and remain in the prompt mode rather than aborting.

The editor is the best I've seen in a C64 software package.  It reminds
me of the VMS EDT editor.  You're essentially always in "insert" mode unless
you enter "command" mode (by pressing run/stop).  The string search/replace/
delete stuff is pretty good, but I can't figure out how to do a cut/paste.
There are actually 2 editors - ed and ced.  Ced is a "syntax-checking"
editor.  It lets you know about things like unbalanced parens, curly-braces
and misused operators - things I'm really good at.  Syntax checking is
invoked with a CH command in command mode.  If an error is detected, the
cursor is placed at the source of the error.  There are NO LINE NUMBERS!
In addition, the screen scrolls forward, backward, right and left.  After
using this editor for a while, I've finally made up my mind that I prefer
a right/left scrolling editor to the 40 columns with line wrap approach.
You get to see more of your program.  The scrolling is automatic when
typing or positioning with the cursor and practically painless.

Several source programs are provided: format (text formatter), 
sort (you guessed it), wfreq (word frequency analyzer - the makings of
a cross-referencer), print and others.  

Now a little bad news.  The documentation is absolutely the skimpiest
thing I've ever seen for a product of this scope.  You actually receive
a general C primer (by the Waite group - ?) which begins at non-programmer
level and progresses slowly.  It was written using the IBM PC as its
target.  The Proline-specific documentation is a very skinny little 
3-hole set of pages (40-50) that mostly describes the function library -
it's terrible!  Also, there are some serious bugs in the dual-1541
feature.  I have not been able to compile using dual disk drives, though
I can edit in two disk mode if I assign the work disk to device 8 and
the sys disk to device 9.  This stuff just could not have been tested prior
to release.  

Is it worth 100.00?  Yes.  In spite of the shortcomings I've mentioned,
I feel like I got a value product for my bucks.  Pro-line provides a
year of software support (updates) at $20.00 a copy.  I hope that this
means the bugs I've mentioned will be fixed sometime soon.  I haven't 
written to them yet, but I will soon.  

Wow!  I really got carried away!  If you have any specific questions,
drop me a line.  I really enjoy the dialogue.

-----------------------------------------------------------------------

Hi,

	I called Abacus this morning and asked about}i their C and
FORTRAN 64 compilers that they announced that would be available
in April.  They said that the C compiler would be available in June
and the FORTRAN compiler would be available in September.

	The girl took my name and address and said that whe would
keep me posted.

-----------------------------------------------------------------------

I just bought "C POWER", the C compiler for the C-64 by B. Hilchie, sold
by Pro-Line Software in Ontario.  I'm pleased to find that it's for real.
(I have no connection whatsoever with the author or publishers.)
I ordered over the phone (416-273-6350) and it arrived in four days
via airmail (!).

The compiler comes on a two-sided floppy. Side one has the compiler, linker,
editors, and a mini-shell.  The shell has rm, mv, cp, cc, link, ls, and
a couple of other utilities.  This is nice to have just by itself.
	There are two editors. "ed" is a screen editor (not like unix(TM)'s "ed"
at all.)  It is fairly simple but quite useful, with vertical and horizontal
scrolling (lines can be well over 100 characters wide.)  I never use it, however;
I use "ced", which is just like "ed"  except that it has a C syntax checker
(and takes longer to load.)  This lets me weed out the syntax errors before
I have to load the compiler proper.
	The implementation is remarkably complete. You can't initialize static
structures;  There are no bitfields (no great loss);
and tabs are not recognized.  
	Side two of the disk has the libraries on it.  There are are lot of functions
supplied, including most of the everyday ones (including such goodies as
malloc, qsort, setjmp/longjmp.) A man page is supplied for each function.

	There are a few drawbacks, however.  If you only have one disk drive,
to compile you must:
	load the compiler disk to run "cc";
	swap to the source disk to let the compiler read your source (you can't	
	put the source on the compiler disk, its write protected);
	swap back to the compiler disk to continue compiling;
	swap to the source disk to write the dot-o;
	Run the linker, which reads the dot-o;
	swap in the flip side of the compiler disk, which reads the libraries;
	swap back to the source disk to write the executable.

This is not the case if you have two drives; you can tell the shell which drive
has the compiler and which has the source. You probably still have to swap in the
library disk when linking, though.
	
The only component which loads slowly enough to be annoying is the compiler itself.
I haven't timed it, but I guess it takes on the order of 45 seconds to get started.
It scans the source at about 180 lines per minute.  Creating the dot-o 
takes another 30 seconds or so for a short program.
Linking is very fast (~10 seconds for a short file, ~20 seconds for the libraries.)
All of this means that an edit-compile-link-run iteration takes 5 minutes or so
and a lot of disk shuffling (get me that other drive!).  However, this is the first
real language I have found for the c64. The generated code sure is fast!
	One other complaint- the compiler is not very tolerant of disk errors.
When using it with my badly aligned drive, I had problems ranging from
hanging to mysterious error messages ("Illegal assignment"?)  which went
away when the disk was repaired.
	The manual mentions a bulletin board for users of the compiler, but
the published number does not answer.  As this is a new product, I assume the
bbs is not set up yet.
	Overall, an excellent piece of software. I plan to do all my programming
in C from here on in.

(TM) UNIX is a trademark of AT&T Bell Laboratories.

----------------------------------------------------------------------

jow