如何在MIPS中获得LSB位? [英] How to get LSB bit in MIPS?

查看:105
本文介绍了如何在MIPS中获得LSB位?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在MIPS中,是否存在一种简短的方法来检查/获取32位整数中的最低有效位?显然,它是为奇数设置的,并且检查整数是否为奇数甚至是偶数的算法可以对此做出决定.但是我只是想知道有没有更好的方法来做到这一点...

Is there a short way to check/get for least significant bit in a 32-bit integer, in MIPS? It is obviously set for the odd numbers and an algorithm which checks for the whole number is odd or even can decide for this. But I just wonder is there a better way to do this...

推荐答案

andi $t0, $s0, 1将获得$s0的最低有效位并将其放入$t0.

andi $t0, $s0, 1 will get the least significant bit of $s0 and put it in $t0.

这篇关于如何在MIPS中获得LSB位?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆