[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cc65 competition?



On Sat, 12 Apr 2008 17:52:34 -0700, Harry Potter wrote:

> On Apr 12, 8:26 pm, Harry Potter <maspethro...@aol.com> wrote:
>> I want to compile a simple Hello, World!" program with just one
>> printf() function and see how it works.
>>
> 
> I just did that.  The following is the listing of the main() function:
> 
> main()
> {
> 	printf ("HELLO, WORLD!\n");
> 	getchar();
> 
> 	exit(0);
> }
> 
> This code produced a 10.9k executable.  If I only include the *used*
> library functions, as cc65 does, I could easily cut down the code
> size.

It would be unnecessary big with `printf()`, at least with cc65, because
all the formatting code will be included.  Try `puts()` for constant
strings instead.

And I don't consider 11 KiB that big.  Remember that cc65 doesn't use the
BASIC ROM, so there is some "base part" that makes short programs seem to
look quite large compared to BASIC counter parts.  Because the BASIC ROM
isn't needed you have about 50 KiB free RAM for C programs on the C64.  So
part of your first feature, use of RAM from $a000-$cfff is already
implemented in cc65.

The RAM from $d000-$ffff is used by the graphics libraries that come with
cc65 or can be accessed through the "memory driver" API.

Ciao,
	Marc 'BlackJack' Rintsch