Search code examples
assemblymips32

possible OR branch mips32?


i'm trying to find a way to do something like bOR $a0, $a1, $a2 else, something like if(a=b||a=c){blablabla}else{blabla} in java, but i don't figure out a way to do it in mips32. Any idea?


Solution

  • Assume you have a in $a0, b in $a1 and c in $a2 then you would do

      beq $a0, $a1, if
      beq $a0, $a2, if
      bgez $zero, else
    if:
        .. code if a=b or a=c
      bgez $zero, endif
    else:
        .. code otherwise
    endif: