This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

Trouble with inline void function using asm


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/



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