C Expression Operands in asm instructions
Dennis Tubbs
dehotu@hotmail.com
Tue Oct 16 07:08:00 GMT 2001
I am compiling a C program for the Motorola 68040 and am having a little
trouble creating a macro which has assembler instructions with C expression
operands. I have read the section "Assembler Instructions with C Expression
Operands" in the "Extensions to the C Language Family" manual but I am not
all that skilled in compiler technology.
The macro I have created is:
#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.
I have tried every operand constraint that seemed like it might apply but no
luck.
This seems like it ought to be rather simple but I am somehow missing it.
Any ideas?
Thanks,
Dennis Tubbs
_________________________________________________________________
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