Do general purpose registers are generally memory mapped?

白昼怎懂夜的黑 提交于 2020-12-13 18:42:39

问题


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.


回答1:


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

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).


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.

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.



来源:https://stackoverflow.com/questions/52308185/do-general-purpose-registers-are-generally-memory-mapped

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!