On Thu, Jul 03, 2008 at 05:16:59AM -0700, Mladen Nikitovic wrote:
> Hi (again),
> 
> could you please describe how you managed to compile and use the macro?
> 
> I created a small test-file (in C) with the following content:
> 
> #define MAGIC(service) do { \
>         asm("sethi %0,%%g0" : : "g" (service)); \
> } while (0)
> 
> #define ASMMAGIC(n) sethi n, %g0;
> 
> 
> #define MAGIC_BREAKPOINT MAGIC(0x40000)
> 
> 
> #endif /* _SIMICS_SIMICS_MAGIC_INSTRUCTION_H */
> 
> 
> void main(void)
> {
>   MAGIC(6000);
> }
> 
> 
> I tried to compile it in the following way:
> 
> /opt/SUNWspro/bin/cc -o test test.c
> 
> But I got this error.
> 
> "test.c", line 24: syntax error before or at: :
> cc: acomp failed for test.c
> 
> I think my Sun Studio compiler is version 11 so that should work, right?

Nope. You should use Studio 12 for gnu-style inline assembler to work.

regards,
  Fedor.

Reply via email to