MIPS上的零美元真的是硬件零吗? [英] $zero on MIPS really hardware zero?

查看:108
本文介绍了MIPS上的零美元真的是硬件零吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对x86-64汇编非常有把握(也许不是专家),但是从一个平台的汇编器到下一个平台的许多方面,它们都是相似的,因此,我还尝试回答实际上不在我范围内的问题的知识,我偶然发现了有关MIPS组装的几个问题.

I'm kind of firm with x86-64 assembly (not an expert maybe), but many aspects are similar from one platform's assembler to the next, so I'm also trying to answer questions that are not actually in my range of knowledge, and I've stumbled upon several questions about MIPS assembly.

这引起了我对详细信息的兴趣,因此我检查了一些在线资源以获取详细信息. mips.com 有很多内容可供阅读,但仅供参考:

This wakened my interest in details, so I've checked several online ressources for detailed information. mips.com has a lot to read, but just for my quick information:

$zero寄存器是常规零还是硬件零?

Is the $zero register just conventional zero or hardware zero?

一些消息来源说它通常是零,其他人则说它总是零.还是后者只是假设它为零,因为按惯例它是零?

Some sources say it is conventionally zero, others claim it is always zero. Or do the latter simply assume it is zero, because it conventionally is?

事先感谢您进行澄清(和/或指向MIPS网站上的特定文档的指针,因此我不需要搜寻实际上不需要的信息).

Thanks in advance for clarification (and/or pointers to a specific doc from MIPS' site, so I don't need to crawl information that I actually don't need).

推荐答案

权威的答案可以在面向程序员的MIPS32®体系结构第一卷:MIPS32®体系结构简介中找到(pdf),可从 mips.com (需要注册).根据该文档中的2.4.8.1节:

The definitive answer to this can be found in MIPS32® Architecture for Programmers Volume I: Introduction to the MIPS32® Architecture (pdf), available at mips.com (registration required). According to Section 2.4.8.1 in that document:

两个CPU通用寄存器已分配功能:

Two of the CPU general-purpose registers have assigned functions:

  • r0硬接线为零,可用作目标 注册任何要丢弃结果的指令. r0可以 当需要零值时,它也可以用作来源.

  • r0 is hard-wired to a value of zero, and can be used as the target register for any instruction whose result is to be discarded. r0 can also be used as a source when a zero value is needed.

r31是JAL,BLTZAL,BLTZALL, BGEZAL和BGEZALL,但未在 指令字.否则,r31用作普通寄存器.

r31 is the destination register used by JAL, BLTZAL, BLTZALL, BGEZAL, and BGEZALL without being explicitly specified in the instruction word. Otherwise r31 is used as a normal register.

其余寄存器可用于通用.

The remaining registers are available for general-purpose use.

这篇关于MIPS上的零美元真的是硬件零吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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