mov eax offset Variable is only 3/4ths correct :)

mov eax offset Variable is only 3/4ths correct :)

Imagen de proussin


Note this is 32 bit code.


This the code:
"mov eax, offset pDevice"
fills eax with: 0xCCEE42BC


The pDevice variable is actually located at 0x00EE42BC
Note that bits 0 to 24 are the same but the high byte of eax is in error.


I repaced the offset experssion with this one:
lea eax,[pDevice]

This produces the correct result: 0x00EE42BC


The colors mean nothing. They come from copying from the debugger.


Paul Roussin


1 envío / 0 nuevos
Para obtener más información sobre las optimizaciones del compilador, consulte el aviso sobre la optimización.