tina nyaa
tina nyaa

Reputation: 1021

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

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

Upvotes: 4

Views: 18957

Answers (1)

Ed Swangren
Ed Swangren

Reputation: 124642

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

Upvotes: 6

Related Questions