Re: Specific register constraints on MIPS

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

 



"Aaron W. LaFramboise" <aaronavay62@xxxxxxxxxxx> writes:

> On the MIPS GCC target, is there a way to write an inline assembler
> constraint for a specific register?

No.

> Here's an example of how I've been working around the issue using
> variables in specified registers.  This is slightly inferior, and
> possibly incorrect.
> 
> void print(const char *string) {
>    const register int num asm("v0") = 4;
>    const register char *const str asm("a0") = string;
>    asm volatile("syscall" : : "r"(num), "r"(str));
> }
> 
> Is there a way to write this without the extra variables?

That is the only way I know to do this.

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