Getting result from mult in mips

心不动则不痛 提交于 2019-12-10 19:23:21

问题


I am new to assembly language, and I am really confused over multiplying.

I was reading the quick tutorial here:http://logos.cs.uic.edu/366/notes/mips%20quick%20tutorial.htm

It says after I use mult $t0, $t1 the results are stored in Hi and Lo, I understand these are special registers for mult and div, but how do I access them?

Lets say I do mult $t0, $t1 where $t0 and $t1 are both 2. How do I get the result? (4)


回答1:


You have to use MFHI and MFLO to move data from HI and LO to general purposes register.

Reference



来源:https://stackoverflow.com/questions/22597994/getting-result-from-mult-in-mips

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!