Re: [cc65] ca65 question

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2008-01-21 08:29:35
Good morning!

On Mon, Jan 21, 2008 at 03:13:22AM +0100, silverdr@inet.com.pl wrote:
> Now, when I link it with "ld65 -t c64 -Ln $(PROGRAM).labels" I get a
> warning:
>
> ld65: Warning: [builtin config](6): Segment `STARTUP' does not exist
>
> and the resulting file loads at $20EE rather than $0801!

You will need to write your own config file for the linker. The builtin config
file is made for programs written by the C compiler. While it is possible to
use this config for asm projects, it is overkill in many cases.

A simple config file to start with would be:

----------------------------------------------------------------------
MEMORY {
    RAM: start = $07FF, size = $C801, file = %O, define = yes;
}
SEGMENTS {
    BASICSTUB: load = RAM, type = ro;
    CODE:      load = RAM, type = ro;
    DATA:      load = RAM, type = rw;
}
----------------------------------------------------------------------

This will create 3 segments: One for the basic stub placed at the start of the
program, one for code, and one for data. It assumes that zeropage locations
are addressed directly.

Then do:

----------------------------------------------------------------------
.segment        "BASICSTUB"
.include        "basicstub.asm"         ; REMOVE .ORG!

.code

main:
        lda     #$00
        ...

.data

foo:    .byte   $00

----------------------------------------------------------------------

Linking is done with:

        ld65 -C my.cfg ...

instead of

        ld65 -t c64 ...

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 Mon Jan 21 08:29:44 2008

This archive was generated by hypermail 2.1.8 : 2008-01-21 08:29:47 CET