This is the mail archive of the crossgcc@sourceware.cygnus.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]

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


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


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