This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mips16 gas 'move' instruction question

I'm sure I'm just being clueless here, but how does one use the mips16
'move' instruction in gas?

In particular, the move instruction can transfer a mips16 register to a
mips32 register or the reverse and I don't see how to distinguish the two
uses since they both appear to make use of the same 'move' assembler

Two specific questions:

(1) I'm having trouble with the following code:

      % cat t2.s
        .set mips16
        move $12,$0

    My intention is to move the contents of MIPS16 register $0 into MIPS32
    register $12.  I believe this would be the equivalent of the MIPS32

      move $12,$16

    because the MIPS16 $0 register is the same physical entity as the MIPS32
    $16 register.  It should assemble into the MOV32R variant of the MIPS16
    move instruction, with the hex value of 0x6588.

    However, the 2002/07/10 snapshot of gas generates the following error

      % as-new --version
      GNU assembler 020710 20020710

      % as-new -mips16 -ggdb -O -G 0 -non_shared -o t2.o t2.s
      t2.s: Assembler messages:
      t2.s:3: Error: illegal operands `move'

(2) In general, if the MOVR32 and MOV32R variants of the MIPS16 move
    instruction both use the 'move' mnemonic, how can gas unambiguously
    interpret a MIPS16 assembler instruction such as:

                     move $2,$4

    This could mean 'move the contents of MIPS16 register $4 into MIPS32
    register $2' or it could mean 'move the contents of MIPS32 register $4
    into MIPS16 register $2'.  The former use requires the MOV32R variant
    of the instruction while the latter requires the MOVR32 variant.

Thanks for any clarifications.

Jeffrey Kuskin                              Tel: +1-408-773-5256
Senior System Engineer                      Fax: +1-408-773-9940
Atheros Communications            

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]