Hi!

I'm either missing something or I'm being fooled by the assembler (maybe invoke?)
Well, here it is:

debugreal .lpLegal
debugdwhex .lpLegal
mov eax,.lpLegal
debugdwhex
invoke AddValue2ListView, hListView, .lpLegal, .lpRule

I'm using the debug macros to check values. They are supposed not to change a single bit of these values.
.lpLegal points to a Real10. Its value according to debugreal is 0. The address of the real is what it is supposed to be (debugdwhex). dumping the contents of the first dword at the address of the real yields 0, which makes sense of course.

So far, so good. Now lets go to AddValue2ListView:

AddValue2ListView proc hListView:DWORD,lpReal:DWORD,lpRule:DWORD
local lvitem:LV_ITEM
local szReal[34]:BYTE

debugreal lpReal
debugdwhex lpReal
mov eax,lpReal
debugdwhex

debugreal now gives ERROR as result, while the address lpReal still is what it is supposed to be. The first dword at the address of the real now is 1. So, something got written over. But how?

Greetz,

BitArt
Posted on 2004-07-23 05:12:47 by BitArt
Hi
I think it's invoke, it happend to once and when I used a different register it worked, so my guess is that invoke do change eax.

peace
Posted on 2004-07-23 07:27:40 by mistronr1
Btw it should not be the invoke. Can you upload a file so that I can debug preferrably without the debuging routines? PS: Get a real debugger :grin:

I think it's invoke, it happend to once and when I used a different register it worked, so my guess is that invoke do change eax.

addr used in invoke makes use of eax if addressing values relative to the stack (local variables). masm should be outputting some warnings as far as I remember (Though it had been quite some time since I have been using masm).
Posted on 2004-07-23 07:39:46 by roticv