Re: [cc65] function style macro usage

From: Tobias Pflug <tobias.pflug1gmx.net>
Date: 2009-03-15 12:48:23
On Sun, 2009-03-15 at 12:39 +0100, Spiro Trikaliotis wrote:
> Hello Tobias,
> 
> * On Sun, Mar 15, 2009 at 12:39:16AM +0100 Tobias Pflug wrote:
>  
> > #define setup_bg1(map,char) (map>>12|char>>8)
> > lda setup_bg1($2000,$00)
> > sta FOOBAR
> > 
> > The way I see it neither .define nor .macro are quite cut out
> > for this. Is there some way this or something syntactically close? :)
> 
> You can do it exactly like this by using a C preprocessor, and feeding
> its output into ca65.
> 
> For gcc, the preprocessor is in the file cpp. cpp --help gives you some
> options you might want to use.
> 
> HTH,
> Spiro.


yeah i've actually been using cc for preprocessing .. 
cc -E foo.asm > foo.S ; ca65 ...
(too bad ca65 doesn't read from stdin btw..)

However I would rather not have cc as a dependency for
assembling 65816 sources.. I'd really prefer if this could
be solved within ca65 .. doesn't seem so though ..

regards,
Tobi

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sun Mar 15 12:48:29 2009

This archive was generated by hypermail 2.1.8 : 2009-03-15 12:48:31 CET