Re: [cc65] Hello and ca65 questions

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2005-05-09 13:52:13
On Mon, May 09, 2005 at 09:48:27AM +0200, 42Bastian Schick wrote:
> Since the Lynx part of cc65 is now included I decided to enter this list
> as well.

Welcome!

> One thing (I fixed myself) are variables.
>
> Many assemblers offer this (using the pseudo I introduced into ca65 :-)
>
> ab == 10
> 	lda #ab
>
> ab == ab +10
>
> 	lda #ab
>
> The resulting code has lda #10 and lda #20.
>
> This works fine for absolute references and could be nicely integrated
> into ca65 w/o touching too much.

Not really. ca65 is a one pass assembler, and as such delays evaluation of
many expressions until end of assembly. If the expression changes several
times, which one should be evaluated in the end?

In general, there's a problem with forward references and variables. As an
extreme example, how should the following get evaluated?

        foo = bar + 10
                .word   foo             ; ?
        foo = foo + 10
                .word   foo             ; ?
        bar = foo + 10
                .word   bar             ; ?
        foo = bar + 10
                .word   foo             ; ?
        bar = 3

> The second thing I have (not yet) found is a way to use macro-parameters
> to construct e.g. labels.

There is currently no way to "build" identifiers. But you are right, this
would be a useful addition.

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 May 9 13:52:21 2005

This archive was generated by hypermail 2.1.8 : 2005-05-09 13:52:24 CEST