Subject: Re: m68k Asm and C
To: NetBSD/mac68k <port-mac68k@netbsd.org>
From: Andy Finnell <andyf@vei.net>
List: port-mac68k
Date: 07/02/1999 13:29:34
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?
>
> -andy
I decided I'd answer my own question. Here's the solution that I used:
#define IMMEDIATE #
#define SYSCALL(x) .even; ENTRY(machdep_sys_ ## x); \
movl IMMEDIATE SYS_ ## x,d0; trap IMMEDIATE 0;
jcs err; rts
Its simple, and it works.
-andy