开发者

MIPS Register comparator

Given two input registers in MIPS: $t0, $t1

How would开发者_开发问答 you figure out which one is bigger without using branches?


You can use the SLT/SLTU instruction (Set Less Than [Unsigned]):

SLT $t2,$t0,$t1

or

SLTU $t2,$t0,$t1

If $t0 is less than $t1 then $t2 will be 1, otherwise $t2 will be 0.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜