I'm newbie to ASM, i want to know how to store value in eax to a variable.
Example :
After using szLen to get a lenght of a zero terminated string, then the result value return to eax, i want to store it (The value in eax) to one variable to use in a future.
I've used:
mov MyVar,eax
but not work.
Sorry for my stupid question. :tongue:
:stupid:
Example :
After using szLen to get a lenght of a zero terminated string, then the result value return to eax, i want to store it (The value in eax) to one variable to use in a future.
I've used:
mov MyVar,eax
but not work.
Sorry for my stupid question. :tongue:
:stupid:
hm, "it does not work" - which error does masm give?
There's a couple of things to consider. First, masm is case sensitive - "MyVar" is different from "myvar". Second, you need to declare the variable before you can use it - put a ".data" or ".data?" section before your code, and do "MyData DWORD 0".
There's a couple of things to consider. First, masm is case sensitive - "MyVar" is different from "myvar". Second, you need to declare the variable before you can use it - put a ".data" or ".data?" section before your code, and do "MyData DWORD 0".
Make sure that MyVar has first been defined somewhere before you attempt to modify its content.
MASM doesn't understand "forwards references" to variables.
MASM doesn't understand "forwards references" to variables.