C Expression Operands in asm instructions

David Korn dkorn@pixelpower.com
Tue Oct 16 07:22:00 GMT 2001

>-----Original Message-----
>From: Dennis Tubbs [ mailto:dehotu@hotmail.com ]

  Didn't you used to be in Miami Vice?

>Sent: 16 October 2001 15:08
>#define BugSystemCall(x)   asm("TRAP #15; DC.W %0"::"n" (x))
>The use of the macro is:
>The the compiler output is:
>	TRAP #15; DC.W #99
>The problem with this is the assembler does not like the '#' in front of
>the 99 and I don't know how to get rid of it.  If I hard code the macro to
>be asm("TRAP #15; DC.W 99") there is no problem.

How about

#define QUOT(x) #x
#define BugSystemCall(x)   asm("TRAP #15; DC.W " QUOT(x))

which adopts and macroizes your hard-code solution!

Burn your ID card!  http://www.optional-identity.org.uk/
Help support the campaign, copy this into your .sig!

This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.

This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.


Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com

More information about the crossgcc mailing list