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

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

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 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.