开发者

MIPS Register comparator

开发者 https://www.devze.com 2023-01-21 18:58 出处:网络
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]):

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

精彩评论

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

关注公众号