Shifting left in MIPS

前端 未结 1 1987
伪装坚强ぢ
伪装坚强ぢ 2021-01-26 17:03

In my method one, I have the number that I want to shift by stored inside $a0 (e.g. 5 bits), and I want to shift $t9 by 5 bits, but I\'m running into a bit of trouble. Does anyo

相关标签:
1条回答
  • 2021-01-26 17:36

    To shift left by a variable amount, use sllv:

    sllv $t9, $t9, $a0
    

    sll only takes an immediate shift amount. There is no need for sw or $t8.

    0 讨论(0)
提交回复
热议问题