Writing MIPS assembler instructions in C

Patrick Mahan mahan at mahan.org
Thu Feb 25 06:26:30 UTC 2010


>> Now my problem is I still need to force the value pointed to "addr" into
>> a specific register because there is a jalr to a function else where
>> that I only have binary access too and it expects it's a value in
>> that register.  Can I coerce this?
>
>I may be missing something here,  but have you tried :
>
>__asm__ __volatile__(
>           "ld     $8, 0(%0)\n\t"
>           "jalr   $8\n"
>           : : "r"(addr) : "$8");
>}
>
>Or is there a reason this will not work?
>

This is the equivalent of "ld t0, 0(a0)", yes?

No I tried that method as well, but without success.  (or so it
seemed to me).

Thanks,

Patrick.


More information about the freebsd-mips mailing list