Re: [cc65] ca65 for stand-alone asm projects

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2010-11-02 20:37:47
Hi!

On Mon, Nov 01, 2010 at 10:52:41PM -0700, Agent Friday wrote:
> Correct me if I'm wrong, but this seems to be mostly (or entirely)
> absent from the documentation.  I doubt that I am the first to
> stumble on this need.  IMO, if ca65 is to be used as one's primary
> assembler and not just for code that supplements a cc65 project,
> then the ability to generate a very simple binary file that can be
> loaded directly into a stock machine is a must.

ca65 is not target specific and the whole package is made so that it is easy
to retarget it to other platforms. There are many machines that use a special
header for executable files. For example, the Commodores have a load address
prepended, or may have a BASIC stub that allows the program to be started by
just typing RUN instead of SYS 12345.

For this reason, platform specific headers aren't added by the assembler or
linker, and this in turn is the reason why there is nothing to document. I'm
quite busy documenting all the things, done by the tools. If I had to add
anything that is *not* done, I could spend the rest of my life with it:-)

What that means is that you have to add necessary headers yourself. Since the
generated code is relocatable, this is easier than you think. With a module
like

        .segment        DISKHEADER
        .word           Start
        Start:

you can add DISKHEADER as the first segment in the output file, and this will
work regardless for which target address the executable binary is linked. It
works similar with other headers. You may want to have a look at the startup
files (crt0.s) for the different platforms to get the idea.

> I'd like to help improve the documentation in this respect... Unless
> Uz prefers I go about it differently, I would just type it up in the
> wiki first, then identify places in the help files that could be
> made clearer.

Of course any help is welcome, and the wiki is a great place to add stuff like
this. Thanks for your efforts!

Regards


        Uz


-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Tue Nov 2 20:37:59 2010

This archive was generated by hypermail 2.1.8 : 2010-11-02 20:38:01 CET