Question

According to book, register is a place in CPU with small storage space (example 16 bit on 16 bits CPU). So how does CPU register have address? And how are we able to add displacement to it if it not in memory but on CPU?

Example for:

mov ax, [bx+1000h]
Was it helpful?

Solution

x86 Registers are only ever addressed by name. The expression bx+1000h simply means, "the value in register bx plus 1000h" and the result is interpreted as an address into memory (via the [...] notation), not into some register space.

The overall interpretation of the expression is, "Load into ax the 16-bits located 1000h bytes after the address bx points to."

OTHER TIPS

It's done by interpreting the content of bx as an address and then displacing that with the offset.

So if bx is 1000h then the content of ax will be stored at memory location 2000h

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top