Re: [cc65] Splitting crt0.s files in two?

From: Ullrich von Bassewitz <>
Date: 2009-11-05 16:47:55
On Thu, Nov 05, 2009 at 03:04:39AM -0800, Fatih Ayg√ľn wrote:
> The first scenario is: I want to write a non-C assembly program. I end up writing an EXE header and footer,
> which I basically copy from crt0.s. If the header/footer were in a separate file, I would just link that and forget
> about it.

I cannot see a real advantage here. For an assembly program, the complete code
in the startup file is almost useless. And when using a header from somewhere,
you need a matching linker config and program entry point. In addition, you
will have to tell the linker to add the header from the library. All this
together is probably too much for any casual ca65 user.

If this were a real advantage, why has no one before used this approach? It is
up to you, to write a small module that contains the header in a special
segment, write a matching linker config and use this as a base for your
assembler programs. Instead everyody (including me!) just writes the necessary
header bytes on top of the assembler file, because this is so much simpler.

> The second scenario is: I want to write a C program but I want to use another binary format. Like a bootable
> disk image, a cartridge image or whatever. I write a custom linker config, I copy the start-up file, I change it
> so that it creates the header/footer for my binary format. If the C run-time initialization code were in a separate file
> I would just write the config and binary header, and link to the library as usual. Moreover, it could be possible
> to supply some alternative config files and header/footer files with the cc65 package for some often used
> binary formats.

Again, I cannot see that a real advantage here. A disk image is usually
created by other tools than ld65. A cartridge needs a new startup code anyway,
because initialization differs. So you have to change the startup code. And
when doing so, it's just 5 seconds to replace the SYS header by a "CBM80"
string or whatever.

You're probably right if you say, that alternative startup files, for example
for ROM cartridges, would a an idea worth thinking about. But I cannot see a
real reason for splitting up the startup files.



Ullrich von Bassewitz                        
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Thu Nov 5 16:49:09 2009

This archive was generated by hypermail 2.1.8 : 2009-11-05 16:49:13 CET