How to pass a #defined constant as an address to the inline assembler
Wed Sep 1 01:21:00 GMT 1999
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:
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
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to email@example.com
More information about the crossgcc