Subject: Re: m68k Asm and C
To: NetBSD/mac68k <port-mac68k@netbsd.org>
From: Andy Finnell <andyf@vei.net>
List: port-mac68k
Date: 06/19/1999 08:00:29
Andy Finnell wrote:
> 
> Bill Studenmund wrote:
> >
> > On Fri, 18 Jun 1999, Andy Finnell wrote:
> >
> > > I'm trying to define a C macro (using #define) that contains m68k
> > > assembly.  In the assembly I use literals that start with '#'.  gcc
> > > complains about this because it wants a macro argument after '#'.
> > > Here's the code:
> > >
> > > #define SYSCALL(x)      .even; ENTRY(machdep_sys_ ## x); \
> > >                         movl \#SYS_ ## x,d0; trap \#0; jcs err; rts
> > >
> > > Unfortunately, I don't know m68k asm that well at all.  Any help?
> >
> > Why are you using a define? I think an inline c routine would be what you
> > want.
> >
> 
> Because this is part of the syscall template file for mit-pthreads.
> This #define will be used to generate code to make syscalls.  It has to
> be asm.  :-(  If I could get away with C, I would.  Thanks for the input,
> 
>         -andy

To answer my own question, it appears that integer literals can work
fine without the # in front of them.  So by removing the \# in front of
SYS_ ## x, and the \# in front of 0, the code is compiling up nicely.  Thanks,

	-andy