问题
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