mflo 语句的使用

发布于 2024-09-16 00:30:09 字数 34 浏览 2 评论 0原文

在汇编语言中何时、何地以及为何应使用 mflo 语句?

When,where and why should the mflo statement be used in assembly language?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

伤感在游骋 2024-09-23 00:30:09

通过从本文档推断,当您想要访问 MIPS 处理器上的乘法或除法结果。

By extrapolation from this document, when you want to access the result of a multiplication or division on a MIPS processor.

慢慢从新开始 2024-09-23 00:30:09

MIPS 乘法器是一个单独的单元,该单元内的指令比其他整数指令消耗更多。这就是为什么对该单元及其提供的结果有不同的处理方式。

该单元的用法如下:

  1. 开始除法乘法,
  2. 并行执行指令
  3. ,将结果存入寄存器HILO,完成后
  4. mfhi 和 mflo

请注意,如果您尝试读取结果时尚未准备好结果,CPU 将等待它们到达。

如果您决定使用 muldiv 指令,则无需考虑 mfhimflo 指令。

MIPS multiplier is a separate unit, and instructions within the unit consume more than other integer instructions. This is why there is a different handling of this unit and results it provides.

Usage of this unit is as follows:

  1. start multiply of divide
  2. execute the instructions in parallel
  3. store results in register HI and LO, when finished
  4. read results with mfhi and mflo

Note that if results are not ready when you try to read them, the CPU will wait until they arrive.

If you decide to use mul and div instructions, you do not need to think about mfhi and mflo instructions.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文