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

From: Agent Friday <64subnet1gmail.com>
Date: 2010-11-08 08:02:28
On Fri, Nov 5, 2010 at 7:30 PM, Daniel Serpell <daniel.serpell@gmail.com> wrote:
> On Fri, Nov 5, 2010 at 7:16 PM, Agent Friday <64subnet@gmail.com> wrote:
>
> But this is not needed if you use a proper linker config file, as the
> header is in a different section. This is flexible, portable and
> really simple.

I get what you're saying now.  I think Uz is OK with changing the C64 default
C64 config to do this.  That would allow the correct START value of $0801 to
be used for the RAM section.

> [. . .] Then, I simply link the header and my own files, which
> define the "_start" symbol as entry-point. The linker config
> file simply adds the header and trailer to the code:
>
> # Atari file format, without initializations.
> FEATURES {
>    STARTADDRESS: default = $2E00;
> }
> MEMORY {
>    ZP:      start = $0082, size = $007E, type = rw, define = yes;
>    HEADER:  start = $0000, size = $0006, file = %O;
>    RAM:     start = %S,    size = $BC20 - %S, file = %O;
>    TRAILER: start = $0000, size = $0006, file = %O;
> }
> SEGMENTS {
>    EXEHDR:   load = HEADER,  type = ro;
>    CODE:     load = RAM,     type = ro, define = yes;
>    RODATA:   load = RAM,     type = ro;
>    DATA:     load = RAM,     type = rw;
>    BSS:      load = RAM,     type = bss, define = yes;
>    ZEROPAGE: load = ZP,      type = zp;
>    AUTOSTRT: load = TRAILER, type = ro;
> }

I looked up the Atari file format.  It is, BTW, rather advanced
compared to the C64...).  For those not familiar, they can contain
an arbitrary number of segments, each specifying its own load
address.  It's can also run an Initialization routine after each
section is loaded, whould would be cool for decompression.  See
http://www.atarimax.com/jindroush.atari.org/afmtexe.html

DANIEL-- I AM PUZZLED by one thing in your config file, and that's
the ZP section preceding the HEADER.  It seems the only way this can
actually work correctly is if your ZEROPAGE segment were empty.  Is
that an error, or am I missing something?


// Agent Friday
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Mon Nov 8 08:02:36 2010

This archive was generated by hypermail 2.1.8 : 2010-11-08 08:02:39 CET