Is there is a way to get the address of a register

2020-06-04 03:26发布

Is there is a way to get the address of a register? For example, the address of the eax register (not it's content).

3条回答
仙女界的扛把子
2楼-- · 2020-06-04 03:45

Registers are physical electrical components inside the CPU's circuitry. They are not in RAM and so have no address. To access it's contents you use the mov instruction.

查看更多
做自己的国王
3楼-- · 2020-06-04 03:53

There has been architectures where low addresses were used to designate CPU registers, like the Univac 1100 series of computers.

http://en.wikipedia.org/wiki/UNIVAC_1100/2200_series

Current x86 hardware doesn't work that way, so you cannot get the address of the EAX register - it just doesn't have one.

查看更多
家丑人穷心不美
4楼-- · 2020-06-04 03:53

Registers are the internal processor storage. They do not have memory addresses, because they do not reside in memory. You identify them by their names: EAX, for example.

That said, memory-mapped registers do exist, but in any modern processor they belong to other devices, never the CPU. They are assigned "fake" memory addresses for convenience. See memory-mapped I/O.

查看更多
登录 后发表回答