开发者

Mips Assembly Language Convert C conditional

How to convert following C conditional statement in MIPS? if (A<=B || B开发者_StackOverflow中文版 == D) where suppose A is stored in $t2, B in $t4, D in $t6


Some pointers

Compare A and B using sltu or slt instruction (they are not the interchangeable). If the condition is satisfied, then that's all (lazyness). Its probably easier using these instructions to check if B < A act on that.

If not, compare B and D using the bneq or beq instruction. Choose one whether you want to fallthrough or branch to the if's body.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜