为什么MIPS汇编器具有更多的返回值是一个寄存器? [英] Why MIPS assembler has more that one register for return value?

查看:379
本文介绍了为什么MIPS汇编器具有更多的返回值是一个寄存器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚开始学习MIPS汇编,并意识到有两个寄存器了解返回值。

I just started learning MIPS assembler and realized that there are two registers for return values.

所有我认为这是实现,因为有可能返回多于一个值(但限制寄存器的数量为2并没有太大的意义)语言第一。依然如<一个href=\"http://programmers.stackexchange.com/questions/203471/why-do-most-programming-languages-only-support-returning-a-single-value-from-a-f\">this Q&安培; A建议,大多数现代编程语言使用只有一个返回值,但强调这意味着在过去有一个返回多个函数值语言中现代,这是MIPS拥有2回寄存器,原因如果是,为什么只有2?

First of all I thought that it was implemented because there are languages that might return more then one value (but then limiting the number of registers to 2 doesn't make much sense). Still as this Q&A suggests, most modern programming languages use exactly one return value, although emphasizing the word "modern" which implies that in past there were languages that returned multiple function values, is this the reason MIPS has 2 return registers, if yes, why only 2?

推荐答案

要能够在32位CPU返回64位值 - 即G。双precision浮点和64位整数。即使有一个返回值的主流语言有数据类型比一个寄存器更大。

To be able to return 64-bit values on a 32-bit CPU - e. g. double precision floating points and 64-bit integers. Even mainstream languages with a single return value have datatypes larger than a single register.

这篇关于为什么MIPS汇编器具有更多的返回值是一个寄存器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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