Is there is a way to get the address of a register? For example, the address of the eax register (not it's content).
Registers do have addresses, even though they don't generally reside in memory. Think about it a minute : an address denotes a location in some space, where memory is just one instance of a space.
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.
A register may hold an instruction, a storage address, or any kind of data (such as a bit sequence or individual characters).
In a computer, the memory address register (MAR) is the CPU register that either stores the memory address from which data will be fetched to the CPU registers, or the address to which data will be sent and stored via system bus.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With