Given the following code:
L1 db \"word\", 0
mov al, [L1]
mov eax, L1
What do the brackets ([L1]) represent?
The brackets mean to de-reference an address. For example
mov eax, [1234]
means, mov the contents of address 1234 to EAX. So:
1234 00001
EAX will contain 00001.
They mean that instead of moving the value of the register or numeric value L1
into the register al
, treat the register value or numeric value L1
as a pointer into memory, fetch the contents of that memory address, and move that contents into al
.
In this instance, L1 is a memory location, but the same logic would apply if a register name was in the brackets:
mov al, [ebx]
Also known as a load.