# inside a macro body

From: Miki Tebeka (miki.tebeka_at_zoran.com)
Date: 09/27/04


Date: 27 Sep 2004 03:51:34 -0700

Hello All,

We're using in-house C pre processor for Assembly development.
We'd like to move to a standard "C" pre processor (such as gcc's "cpp").

However we have the following problem:
Out assembly code have the following syntax:
move #2, d1;

How can I write a macro that will produce the above line?
If I try:
#define mv(reg) move #2, reg;
I get (for cpp -E):
f:1:23: '#' is not followed by a macro parameter

I've tried with ## and \# but it doesn't work.
Is there a way around this?

Thanks.
Miki