通用寄存器通常是内存映射的吗? [英] Do general purpose registers are generally memory mapped?

查看:40
本文介绍了通用寄存器通常是内存映射的吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对内存映射和内存映射 I/O 很困惑.例如,ARM 体系结构 r0、r1 等中的通用寄存器通常是内存映射的吗?请帮忙.

I am very confused with Memory Map and Memory mapped I/O. Do general purpose registers for example in ARM Architecture r0, r1, and etc are generally memory mapped? Please help.

推荐答案

不,这些寄存器在实际 CPU(或多核 CPU 的 CPU 内核)内.您无法通过内存访问它们.

No, those registers are inside the actual CPU (or CPU core for multi-core CPUs). You can not access them through memory.

内存映射寄存器是您通过地址或指针(在具有指针的语言中)访问的东西.I/O 设备通常具有内存映射寄存器,您可以在其中写入或读取特定地址以设置或获取信息或数据.换句话说,它们就像任何其他内存(例如 RAM)一样被访问.

A memory-mapped register is something which you access through an address or a pointer (in languages that has pointers). I/O devices often have memory-mapped registers, where you write to or read from a specific address to set or get information or data. In other words, they are accessed just like any other memory (e.g. RAM).

正如评论中提到的,确实存在带有内存映射 CPU 寄存器的 CPU.它们几乎都是在 1970 年代设计的,除了 PIC 微控制器(也许还有8051 架构)现在已成为历史的一部分.如今,您遇到具有内存映射寄存器的主流 CPU(PIC 除外)的可能性微乎其微.

As mentioned in comments, there do exist CPUs with memory-mapped CPU registers. They were almost all designed in the 1970's and with the exception of PIC microcontrolers (and perhaps modern implementations of the 8051 architecture) are part of history now. The chances you would encounter a mainstream CPU (except PIC) with memory-mapped registers these days are slim to none.

更具体地说,ARM 架构没有具有内存映射寄存器.无论如何不适用于核心寄存器.外设,包括与 CPU 位于同一 SoC 上的外设,则是另一回事.

More specifically, the ARM architecture do not have memory-mapped registers. Not for the core registers anyway. Peripherals, including those on the same SoC as the CPU's, are a different matter though.

这篇关于通用寄存器通常是内存映射的吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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