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
精彩评论