The square brackets essentially work like a dereference operator (e.g., like *
in C).
So, something like
mov REG, x
moves the value of x
into REG
, whereas
mov REG, [x]
moves the value of the memory location where x
points to into REG
. Note that if x
is a label, its value is the address of that label.
As for you're question:
Am I correct in understanding that bl will contain the value 5, and cl will contain the memory address of the variable buffer?
Yes, you are correct. But beware that, since CL
is only 8 bits wide, it will only contain the least significant byte of the address of buffer
.