[mips-gnu-discuss] Issue with current mips-4.4-303 toolchain

Jean-Baptiste Note jbnote at gmail.com
Thu Apr 28 09:37:35 UTC 2011


Hi,

As far as I know, the correct syntax would be more like
addu $0, $1, $2

You can shortcut by defining macros like:
#define a0      $4
#define a1      $5
#define a2      $6
#define a3      $7

which yields

addu a0, a1, a3

Don't know what the assembler interprets if you mix letters in there.

JB

On Thu, Apr 28, 2011 at 11:05 AM, Girish Verma <girish at circuitsutra.com> wrote:
> Hi,
>
> I am currently using "mips-4.4-303" downloaded from Codesourcery. I found
> two issue regarding the "ADDU" instruction in asembler and disassembly (
> with objdump -d ), Please see the detail of issue and let know is this a bug
> in toolchain or i have missed out something here
>
> [Issue 1]
> In my assembly file when i write "addu $v0,$a4,$v0" it generate error
> "Error: illegal operands `addu $v0,$a4,$v0'",
>
> [Issue 2]
> In case i try to assemble "addu $v0,$t0,$v0", mips is able to genrate object
> code, but when i see the disassembly of same object code generate  I see the
> following entry corresponding  to "addu $v0,$t0,$v0" instruction.
>
> =========== objdump output entry ==============
> 0000000c <test+0xc> 01021021  addu  v0,t0,v0
> =============Entry end ====================
>
> As i am getting right instruction  in disassembly but we can see the opcode
> is printed wrong as per MIPS instruction spec.
>
> 0x01021021 === 0000-0001-0000-0010-0001-0000-0010-0001
>
> R type instruction
>     6            5       5      5      5       5
> [Opcode] [ Rs ] [Rt] [Rd] [sa] [function]
>
>                  r8=a4
> 000000 -  01000  - 00010 -  00010 - 00000 - 100001
>
> opcode value denote  r8=>a4 but in disassembly it show t0=>r12
>
> Is this a bug in tool or i have made some wrong interpretation of MIPS
> instruction set?
>
> Best Regards
> Girish Verma
>
>
>



-- 
Jean-Baptiste Note



More information about the mips-gnu-discuss mailing list