C Expression Operands in asm instructions

Dennis Tubbs dehotu@hotmail.com
Tue Oct 16 09:26:00 GMT 2001


Not me, I am surprised anyone still remembers that show!

Your suggestion worked.  I was actually really close to that solution myself 
but gave up with asm("TRAP #15; DC.W #x") which didn't work because the #x 
was not getting substitued for within the "".

Thanks,
Dennis


>From: David Korn <dkorn@pixelpower.com>
>To: 'Dennis Tubbs' <dehotu@hotmail.com>, crossgcc@sourceware.cygnus.com
>Subject: RE: C Expression Operands in asm instructions
>Date: Tue, 16 Oct 2001 15:25:54 +0100
>
> >-----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
>


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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