tags:

views:

231

answers:

2

I tried to do the following:

andi $s7, $s6, 0x1      # (i + j) & 1 (to check if it's even)

however it generates an error... am I doing something wrong?

+1  A: 

bneq does not exist.

Use

bne $s7,$zero,else

Post edit:

Heres a working example

  #include<mips/regdef>
    ...
    andi    t1,t1,0x1

Please add any error msg!

Tom
yes, I changed that as well but still it doesn't work... problem is at andi
EquinoX
any error msg ?
Tom
+2  A: 

Try

andi $s7, $s6, 1

Or

andi $23, $22, 1      # $22=$s6  and   $23=$s7

If you use SPIM Simulator, first code should work.

Note that the comment of the code you show, does not describe the code line.

andi Rdest, Rsrc1, Imm
Put the logical AND of the integers from register Rsrc1 And Imm into register Rdest.

Gero
Yes, it could be that your simulator doesnt support it.
Tom