Re: [cc65] Space efficiency?

Date view Thread view Subject view

From: groepaz (groepaz_at_gmx.net)
Date: 2002-05-17 15:54:25


Hello Stephan,

SL> What do you think, can I assume that the size of a compiled C program
SL> (modulo silly programming :)) will be about 1 to 1.5 times that of a 
SL> hand-written assembly program for the same purpose, plus ca 3 K for the 
SL> library?

it depends on the actual size of your program.... the larger your
program will be, the less "overhead" (in terms of size) you will have.

SL> Generally, those who already have realized larger projects under cc65,
SL> particularly on the c64 and including interfaces to binary parts like musics
SL> and IRQ loaders, could you tell how well it went, and what experiences
SL> you made? Does it actually become easier to write a program like a game
SL> in C, compared to assembly, and can you write the major parts in C, or
SL> do you end up with a frame program in C, and the rest mostly written in
SL> assembly?

biggest problems/pitfals are probably with interfacing to "foreign"
assembly....that is code that is tied to a fixed memory location (eg
lotta music tied to $1000) and you dont have sources for it either so
you can recompile - my suggestion for that would be, use a
musicroutine and an irq-loader that you have sources of and convert
those to ca65 syntax....this way they will integrate into the rest of
your project nicely.

second thing is working with interupts themselves - you will most
likely end up in coding all your interupt-services in assembler (it
could be done in C with some hacking but its in no way reasonable)

generally, i'd say write your "main loop" in C, and put everything
else in a tiny dedicated library (which you are ofcoz supposed to
release for everyone to use...etc ;=P hehe) .... that is, combine the
best of both worlds, start writing stuff in C, debug it and then
convert the logic to assembler (maybe based on the compiler output).

-- 
Best regards,
 groepaz                            mailto:groepaz_at_gmx.net


----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2002-05-17 15:52:48 CEST