Re: [cc65] ca65: Problem with generic labels...

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2007-08-21 14:54:20
Hi!

On Sun, Jul 08, 2007 at 09:13:34PM +0200, Christian Krüger wrote:
> I've tried to build some generic .proc names of
> routines which are called in sequence but have no success:
>
> .repeat 9, DLIcount
> .proc .ident(.concat("DLI",.string(DLIcount)))
>        MyMacro .ident(.concat("DLI",.string(DLIcount+1)))
> .endproc
> .endrepeat
>
> .proc DLI10
>       ....
> .endproc
>
> wont't work (ca65 comes up with some errors and .string
> also seems to behave strange and does not convert the
> number to the desired labels "DLI1","DLI2" etc..

DLIcount is handled special inside a .repeat statement. You will have to
ressort to a separate macro to make it work:

.macro  MakeProc  Num
.proc .ident(.concat("DLI",.sprintf("%d", Num)))
        ....
.endproc
.endmacro

.repeat         9, DLIcount
        MakeProc DLIcount
.endrepeat

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 Tue Aug 21 14:54:33 2007

This archive was generated by hypermail 2.1.8 : 2007-08-21 14:54:36 CEST