mov ax, bx vs. mov ax, [bx]

tina nyaa picture tina nyaa · Sep 3, 2011 · Viewed 17.6k times · Source

What is the difference between the following two lines?

mov ax, bx
mov ax, [bx]

If bx contains the value 100h and the value at memory address 100h is 23, does the second one copy 23 to ax?

Also, what is the difference between the two following lines?

mov ax, 102h ; moves value of 102h into register ax
mov ax, [102h] ; Actual address is DS:0 + 102h

Answer

Ed S. picture Ed S. · Sep 3, 2011

Yes. The operand between the brackets is treated as an address and the value at that memory address if fetched.