Trouble with inline void function using asm
Jeff Hammond
jshammond@my-deja.com
Tue Jan 23 17:44:00 GMT 2001
Hi,
I am trying to use the following inline function on my compiler.
inline void write_altmem(register short data, register int addr)
{
asm("SALT r%0,r%1,0 ; write_altmem"
: "r"(data) : "r"(addr) );
}
I get the error message:
memaccess.c:11: output operand constraint lacks `='
I didn't think that I would need a '=' since there are no output
variables. When I put an '=' in the first argument there are
no compiler errors but the compiler decides that this function
doesn't do anything and optimizes it out.
Any help with this will be appreciated.
Jeff
------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/
More information about the Gcc
mailing list