Specific register constraints on MIPS
Ian Lance Taylor
iant@google.com
Mon Feb 5 20:19:00 GMT 2007
"Aaron W. LaFramboise" <aaronavay62@aaronwl.com> 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
More information about the Gcc-help
mailing list