flat assembler
Message board for the users of flat assembler.

Index > Windows > Defining local variables outside of proc

Author
Thread Post new topic Reply to topic
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler 21 Apr 2010, 14:52
What is the best way of defining local valiables outside of a proc, for example at an entry point? Anything better than reserving stack space and declaring virtual variables? Anything better than:

Code:
.code
 start:
        call    main
        ret    

_________________
This is a block of text that can be added to posts you make.
Post 21 Apr 2010, 14:52
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20445
Location: In your JS exploiting you and your system
revolution 21 Apr 2010, 15:02
There are no local variables in your example. What is it you want to do? Local variables are always on the stack when the program runs but you seem to be asking how to have them, somehow, not on the stack?
Post 21 Apr 2010, 15:02
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 21 Apr 2010, 15:06
For the code I think that he is probably wanting this?
Code:
.code
proc start ; Instead of "start:"
;locals here

;code here

invoke ExitProcess, 0 ; Or just "ret" BUT Windows documentation is not clear about this and could not work on future Windows versions.
endp    
Post 21 Apr 2010, 15:06
View user's profile Send private message Reply with quote
mindcooler



Joined: 01 Dec 2009
Posts: 423
Location: Västerås, Sweden
mindcooler 21 Apr 2010, 15:09
@Loco:
Absolutely!

Time to wear the dunce cap for a while.. :S
Post 21 Apr 2010, 15:09
View user's profile Send private message Visit poster's website MSN Messenger ICQ Number 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.