linux-mips
[Top] [All Lists]

Re: some question about Extended Asm

To: loody <miloody@gmail.com>
Subject: Re: some question about Extended Asm
From: "Maciej W. Rozycki" <macro@linux-mips.org>
Date: Wed, 6 Jan 2010 12:48:45 +0000 (GMT)
Cc: Linux MIPS Mailing List <linux-mips@linux-mips.org>
In-reply-to: <3a665c761001052313v36bfeb89v37ada6b76e91c271@mail.gmail.com>
References: <3a665c761001052313v36bfeb89v37ada6b76e91c271@mail.gmail.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Alpine 2.00 (LFD 1167 2008-08-23)
On Wed, 6 Jan 2010, loody wrote:

> I try to
>   "or %0, count\n", where count is $a1.
> so I write %1 as count and write
>   "or %0, %1\n" and assign %1 as count in input section.
> 
> But the result is not what I expect.
> the result is "   or      v1,v1,v0"
> Did I miss something or the only way to meet what I need is directly write
>  "or %0, $a1\n"?

 As you can figure out from the semantics:

        or      v1, v0

is a shorthand for:

        or      v1, v1, v0

There is no two-argument register OR instruction in the standard MIPS 
instruction set (nor there is a need for one).

  Maciej

<Prev in Thread] Current Thread [Next in Thread>