assembly - Segment ignored in effective address with nasm -
i trying write simple bootloader in x86 assembly using nasm. @ several places in code, have use effective address of form [es:di]
. code compiles without error, @ run time, segment ignored. instance, for
mov ax, 0x07c0 mov es, ax mov di, 0x10 lea eax, [es:di]
right after lea
, registers :
eax=00000010 edi=00000010 es =07c0 00007c00 0000ffff 00009300
but eax should have been 7c10
. problem occurs @ point of program (including when nothing has been done before), , program runs in real mode.
my question is: normal? missing something? how can fix this?
intel's manual may not super clear on this. or may not obvious look, @ least. if read section 7.3.16.1 (address computation instruction
), says:
the
lea
(load effective address) instruction computes effective address in memory (offset within segment) of source operand , places in general-purpose register.
so, yes, i'd result expected one.
Comments
Post a Comment