为什么MIPS汇编器具有更多的返回值是一个寄存器?
我刚开始学习MIPS汇编,并意识到有两个寄存器了解返回值。
I just started learning MIPS assembler and realized that there are two registers for return values.
所有我认为这是实现,因为有可能返回多于一个值(但限制寄存器的数量为2并没有太大的意义)语言第一。依然如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.