Re: [cc65] command line args

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-05-14 14:49:10
Hi!

On Fri, May 14, 2004 at 10:48:20AM +0200, carlos wrote:
> But instead of a  "xyz not known" error message, the assembler outputs
> "constant expression detected", which doesn't give you a clue about what has
> happened. Using .define it is much less complicate in this case.

The assembler says "Constant expression expected" - which is quite the
contrary. This problem happens in several other contexts, and is related to
ca65 being a one pass assembler. The assembler doesn't know if the symbol will
get redefined within the scope, overriding the global definition, so it delays
evaluation in most cases until the scope is closed. In the given case, it
needs to generate code, so this delayed evaluation is not possible.

A simple solution which has been mentioned more than once is to use explicit
scoping syntax for the symbol:

        NREP = 10
        .proc   xyz
                .repeat ::NREP * 8, xvar
                        lda #xvar
                .endrep
        .endproc

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 Fri May 14 14:49:14 2004

This archive was generated by hypermail 2.1.8 : 2004-05-14 14:49:21 CEST