从多重技巧中获得结果 [英] Getting result from mult in mips

查看:97
本文介绍了从多重技巧中获得结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是汇编语言的新手,我对乘法很困惑.

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

我在这里阅读快速教程: http://logos.cs.uic.edu/366/notes/mips%20quick%20tutorial.htm

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

它说在我使用mult $t0, $t1之后,结果存储在Hi和Lo中,我知道这些是multdiv的特殊寄存器,但是如何访问它们?

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?

让我说我做mult $t0, $t1,其中$t0$t1都是2.如何得到结果? (4)

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

推荐答案

您必须使用MFHIMFLO将数据从HILO移至通用寄存器.

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

参考

这篇关于从多重技巧中获得结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆