Re: [cc65] function style macro usage

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-03-17 18:19:48
Sorry, I have been out of town for a few days ...

On Sun, Mar 15, 2009 at 12:39:16AM +0100, Tobias Pflug wrote:
> The way I see it neither .define nor .macro are quite cut out
> for this. Is there some way this or something syntactically close? :)

See "C style macros" at http://www.cc65.org/doc/ca65-11.html#ss11.7

The following works:
------------------------------------------------------------------------------
.define setup_bg1(map,char) 0+((map .SHR 12) .OR (char .SHR 8))

        lda     setup_bg1($2000,$00)
        sta     $1234
------------------------------------------------------------------------------

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 Mar 17 18:22:03 2009

This archive was generated by hypermail 2.1.8 : 2009-03-17 18:22:06 CET