When I use the LEA instruction into a NASM code running in protected mode,
LEA calculate the offset about where?
(Sorry my poor english)
pepito
LEA instruction
RE:LEA instruction
it returns the offset value from the selector starting point.
It does nothing more than copying the value from the register.
...
YogaRamanan.T
It does nothing more than copying the value from the register.
...
YogaRamanan.T
RE:LEA instruction
lea finds the offset from the base of your segment for the current variable used within the instruction.
i.e.
if i have a base of zero, beginning of ram and do...
lea eax, [somevariable]
eax will contain the offset from the segment base (zero), i.e. the location of the somevariable variable and place it in eax.
You could always look inside the intel manual 2, it goes pretty far when instructions are concearned, and the assembler doesn't make any difference. Instructions are instructions, they all do the same.
Dangamoose
i.e.
if i have a base of zero, beginning of ram and do...
lea eax, [somevariable]
eax will contain the offset from the segment base (zero), i.e. the location of the somevariable variable and place it in eax.
You could always look inside the intel manual 2, it goes pretty far when instructions are concearned, and the assembler doesn't make any difference. Instructions are instructions, they all do the same.
Dangamoose