开发者

Looking for instruction that flips/reverses bytes in a word

I need to flip/reverse the bytes in a 4-byte word, for the purpose of displaying it 开发者_开发百科on LED display.

Apparently there is one simple instruction to accomplish this, but I was unable to find it anywhere.


nor?

nor $d,$s,$t    $d = ~ ($s | $t)

Edit:

Can't seem to find a 32-bit byteswap instruction, but can you byteswap the halfwords and then swap the halfwords?

li   $t0,0xABCD    ;ABCD
wbsh $t0,$t0       ;BADC
rotr $v0,$v0,16    ;DCBA
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜