Re: FW: Inline Assembler for PPC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Martin Payne" <martin@xxxxxxxxxxxxxxx> writes:

> So, it is impossible to get the value of r3 into a local variable?

No.  It's just wrong to use stw with an "r" constraint.  The "r"
constraint means that the value needs to be in a register.  That's
fine, but using it with stw is not fine.

For example, try this:
  asm ("mr %0,3" : "=r" (i) : );

Note that since the value is to be stored into the local variable i,
it is an output operand.  I've put it in the list of output operands,
and I've added the "=" constraint which is required for all output
operands.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux