简体   繁体   中英

Why MIPS assembler has more that one register for return value?

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

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM