This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: C Expression Operands in asm instructions


>-----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:
>
>BugSystemCall(99);
>
>The the compiler output is:
>
>#APP
>	TRAP #15; DC.W #99
>#NO_APP
>
>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!

       DaveK
-- 
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.

www.mimesweeper.com
**********************************************************************

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]