Shifting down bits in MIPS for a floating point multiplication

时间:2016-04-04 17:31:03

标签: assembly mips bit-shift

Say I had two significands stored in t2 and t3, and I wished to multiply them. I'd do so with:

 mult $t2, $t3

I'm multiplying two 24 bit numbers, so result is going to be 48 bits in total stored in the HI and LO registers. Now what I need to do is shift down the bits in the HI and LO registers so that a leading 1 present in bit position 48 is going to be shifted to bit position 24.

I'd appreciate any tips on how to deal with this problem ... I don't know how to code such a shift, especially since I have two different registers i'm dealing with.

1 个答案:

答案 0 :(得分:0)

重新发布Jester的评论:

  

请注意,前导1位不在固定位置。至于在寄存器之间进行转换,这只是一些简单的小问题。您将低位单词向右移动,然后向高位单词向左移动,以便正确对齐以转换为低位单词,这是通过按位or进行的。 - 杰斯特4月4日17:43

相关问题