flat assembler
Message board for the users of flat assembler.

Index > Windows > A Rather Newbish Question

Author
Thread Post new topic Reply to topic
proveren



Joined: 24 Jul 2004
Posts: 68
Location: Bulgaria
proveren 13 Dec 2004, 19:35
Howcan i statically reserve memory for my program, without this memory be part of the size of my executable?
For example, if i have 5kbytes of code and want to have 10kbytes of data uninitialized, i would not want to have a statement of rb 10*1024 in my data segment, and end up with a 15kb executable. I would like a 5KB executable. In MenuetOS this is possible, when you say the amount of memory you need in the header .
Is such thing possible under Windows?
Post 13 Dec 2004, 19:35
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 13 Dec 2004, 20:25
proveren wrote:
Is such thing possible under Windows?


Yes, of course.
1. You have to define those 10kbytes as undefined data, i.e. using rb, rw, rd, etc. or as undefined db, dw, dd directives.
2. All undefined data must be defined at the end of the section, where you want to reside. Every defined data byte after it will add those 10k to the size of the exe.

For easy definition of such data and automatically grouping it in right place and in right order you can use the macro library "globals.inc" from Fresh package.

Regards
Post 13 Dec 2004, 20:25
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
proveren



Joined: 24 Jul 2004
Posts: 68
Location: Bulgaria
proveren 13 Dec 2004, 20:42
OMG, thanks John.
I was wondering about why to use rb, and not db 0, and what the point was of reserve directive at all.
I feel a little bit ashamed now, but many thanks to you.
Keep updating with the Fresh project Wink
Post 13 Dec 2004, 20:42
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.