In most assemblers, using square brackets dereferences a memory location. You are treating the value as a memory address.
For example, let's take this for an example.
mov ax, [0x1000]
This will get the value at 0x1000 and put it into AX. If you remove the square brackets, you only move 0x1000.
If you move a value to a number, you are putting it into the value (memory location).
If you are a C developer, here's an example problem.
Don't let this example annoy you if you've been bullied into learning C by others, calling you a 'troll'.
You can ignore this if you want but you might have known about scanf()
if you know C.
int a = 10;
scanf("%d", a);
Now, this is a very common mistake because we are not getting the memory address of the variable. Instead, we are using its value as the address. The scanf()
function requires you to give the the address.
If we did this,
scanf("%d", &a);
we would have the address of the variable a.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…