[cc65] Config file expressions (was: To Atari platform coordinator)

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-07-28 22:01:05
On Tue, Jul 26, 2005 at 11:01:54PM +0200, Ullrich von Bassewitz wrote:
> On Mon, Jul 25, 2005 at 10:18:31PM +0200, Christian Groessler wrote:
> > But there is a small problem: I cannot set the size of the memory chunk
> > depending on the selected start address. I've now used the size value for
> > the default start address, but if the start address is changed from the
> > command line, the size will be incorrect.
>
> Yes, expressions in the linker config files would be needed.

... and are available now. I've added simple expressions to the config file
parser. Currently only + - * / are available, more operators can be added when
necessary. This allows things like:

FEATURES {
    STARTADDRESS: default = $801;
}
SYMBOLS {
    __STACKSIZE__: value = $800, weak = yes;    # Default is 2K stack
}
MEMORY {
    ZP:  start = $0002, size = $001A, type = rw, define = yes;
    RAM: start = %S - 2,        # Account for two byte load address in file
         size = $D000 - __STACKSIZE__ - %S - 2,   # Total available memory
         file = %O, define = yes;
}

Please note that expressions must be constant at the time when the config file
is read. Since placement of segments is done *after* the config file is read,
symbols created by "define = yes" in the SEGMENTS or MEMORY sections are NOT
available in config file expressions.

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 Thu Jul 28 22:01:27 2005

This archive was generated by hypermail 2.1.8 : 2005-07-28 22:01:31 CEST