flat assembler
Message board for the users of flat assembler.

Index > Windows > How can I produce variables?


What is best Assembler?
FASM (you should know)
77%
 77%  [ 7 ]
MASM (Microsoft ASM)
11%
 11%  [ 1 ]
NASM (Net ASM)
0%
 0%  [ 0 ]
TASM (Turbo ASM; Borland)
0%
 0%  [ 0 ]
some other stuff that I (the author) never heard of before
11%
 11%  [ 1 ]
Total Votes : 9

Author
Thread Post new topic Reply to topic
ProgrammierenMV



Joined: 24 Jan 2004
Posts: 5
Location: Germany
ProgrammierenMV 29 Jan 2004, 20:07
As a kind of newbie in Assembler, I searched for tutorials. I only found two of them, but nothing was said about how to declare or define variables.
I'm quite sure there's somebody how knows how to do.

Thank you
Post 29 Jan 2004, 20:07
View user's profile Send private message Visit poster's website Reply with quote
ronware



Joined: 08 Jan 2004
Posts: 179
Location: Israel
ronware 29 Jan 2004, 20:20
ProgrammierenMV wrote:
As a kind of newbie in Assembler, I searched for tutorials. I only found two of them, but nothing was said about how to declare or define variables.
I'm quite sure there's somebody how knows how to do.

Thank you

All a variable is, is a memory location where you store data. So assuming you want to store a DWORD (4 byte value), you would have:

my_variable dd 0

(or similar) somewhere in your data segment (or code segment if that is writeable in your application).

Then to load it into EAX, for example,
mov eax, [my_variable]

Do something:
inc eax
mov [my_variable], eax ; save it
Post 29 Jan 2004, 20:20
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.