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

See the CrossGCC FAQ for lots more infromation.


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

M68k Inline Assmbly with C Style Operands


Hi,
 
Using gcc-2.95.2 cross development tools  for a m68k-elf target under Cygwin, I am having problems getting inline assembly with C operands to compile/assemble/link:
 
// Example 1: No C style operands  works fine.
asm("move  0x2700, %sr"); 
 
// Example 2: The % in %sr made the compiler look for another operand.
#define MY_MACRO 0x2700
 
asm("move  %0, %sr;"
    :
    : "i"(MY_MACRO)
);
 
// Example 3: Would not link because sr is undefined.
asm("move  %0, sr;"
    :
    : "i"(MY_MACRO)
);
Any suggestions for making Example 2 or Example 3 work?
 
Thanks,
Alex

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