flat assembler
Message board for the users of flat assembler.

Index > Windows > Data allocation at runtime

Author
Thread Post new topic Reply to topic
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
How would you make a data sections that allocates the memory needed at runtime and not in a normal data section? I guess this would be a .bss section, but how would you do this in fasm?
Post 03 Sep 2005, 22:44
View user's profile Send private message Reply with quote
farrier



Joined: 26 Aug 2004
Posts: 274
Location: North Central Mississippi
farrier
madmatt,

This works for me:

Code:
section '.bss'          readable writeable

gIst                    dd      0
gWnd                    dd      0
hInstance               dd      ?
    



hth,

farrier

_________________
Some Assembly Required
It's a good day to code!
U.S.Constitution; Bill of Rights; Amendment 1:
... the right of the people peaceably to assemble, ...
The code is dark, and full of errors!
Post 04 Sep 2005, 00:16
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3170
Location: Denmark
f0dder
Data allocation at runtime is basically HeapAlloc or VirtualAlloc. .bss is "allocated" at load-time, not run-time Smile (but of course then there's the issues of demand-zero paging, heh).
Post 04 Sep 2005, 03:48
View user's profile Send private message Visit poster's website Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
all right, thanks for all your help. I was doing it wrong you have to use the '?' symbol when defining data, or else it will be allocated in the executable.
Post 04 Sep 2005, 08:43
View user's profile Send private message 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.