MIPS中的不平等

时间:2015-03-24 11:35:20

标签: mips inequality inequalities

我可以问一下,我是否已经把它与MIPS中的以下不等式相提并论了吗?或者有没有更好的方法来实现slt和bne和bqe的基本命令?

less than <
slt $t0, $s1, $s2
beq $t0, $zero, L
  ....
L:

less than equals <=
addi $s2, $s2, 1
slt $t0, $s1, $s2
beq $t0, $zero, L
   ....
L:

greater than >
slt $t0, $s1, $s2
bne $t0, $zero, L
  ....
L:

greater than equals >=
addi $s2, $s2, 1
slt $t0, $s1, $s2
bne $s0, $zero, L

0 个答案:

没有答案