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 03 Sep 2005, 22:44
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 04 Sep 2005, 00:16
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: 3175
Location: Denmark
f0dder 04 Sep 2005, 03:48
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 04 Sep 2005, 08:43
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.