How to pass a #defined constant as an address to the inline assembler

Mark Jonas jonas@informatik.uni-freiburg.de
Wed Sep 1 01:21:00 GMT 1999


Hi,

I am trying to pass a constant (defined with #define) to the inline
assembler (CPU32) as an address and it does not do what I expect.

This is my code:
--
unsigned short foo;
#define MODBASE  0xFFFFF000L
#define CNTR1   (MODBASE+0x060A)
asm volatile ("move.w %1,%0" : "=g" (foo) : "g" (CNTR1));
--

And the inline assembler generates:
--
move.w #0F60A,(0FFFE,A6)
--

This looks OK except that the constant is used as an immediate value.

How do I tell the inline assembler that a constant is to be used as
an address and not as an immediate value?

Thanks in advance
Mark Jonas

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