10/16/2007

[] Operator in IA-32 assembly code

[] bracket operator means get the content of the memory location, u can treat [location] as addressing expression.

The following C code:
int i;
i = 0x1234;

can be translate to assembly code which looks like this:
mov dword ptr [i], 1234h

the dword ptr means the content of variable i occupied 4 bytes. It is required because of IA-32 is byte addressable. And above mov instruction does not know how much storage requires for storing immediate number 1234h.