Re: [cc65] Temporary zero-page allocation

From: Ullrich von Bassewitz <>
Date: 2013-10-27 22:55:02
On Sun, Oct 27, 2013 at 10:21:38PM +0100, doynax wrote:
>    I vaguely described a couple of ideas in my original post but at a guess
>    some form of compile-time stack based on the maximum (recursive) depth of
>    a manually specified callees would seems like the most realistic solution.
>    Sprinkled with liberal assertions.

I have never tested something like that, but I think that getting it right is
more work than what it saves. The biggest 6502 assembler program I've managed
in my history was Elite 128. I remember quite some nasty bugs, but no real
problems with management of zero page variables. Maybe this is why I don't
rate the problem as really serious. Your mileage may of course vary.

>    Can I get the linker to evaluate max() at link-time?

If you mean .MAX then yes, it has always been evaluated at link time if
necessary. As is true for any operator in an expression. But the usual limits
apply: You cannot decide at link time about memory allocation. So

        .import foo, bar
        .res    .max (foo, bar)

will not work.



Ullrich von Bassewitz                        
Encrypted email preferred                          PGP Key-Id: 29D93B10
To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Oct 27 22:55:09 2013

This archive was generated by hypermail 2.1.8 : 2013-10-27 22:55:11 CET