flat assembler
Message board for the users of flat assembler.

Index > DOS > Exe question

Author
Thread Post new topic Reply to topic
avcaballero



Joined: 02 Feb 2004
Posts: 203
Location: Madrid - Spain
avcaballero 21 Jul 2005, 08:46
Hello

I've done a program which i've resized memory block using an ending segment to calcule program size and i've reserved memory for a temporal buffer. For the first step I've seen that is not sufficient defining variables with reserved memory, i need fulfill them whith zeroes (for example) to can calculate the size of the executable. For the second issue I've checked that is not a good idea to use "STACK 100h" for example, instead:
SEGMENT Stack
TIMES 100h DB 0
[...]
SEGMENT Text
MOV SS, Stack
MOV SP, 100h-2

With this changes, the program works fine. The final executable is shorter than the same in MASM and NASM compilers.

My question is: Is there a way to do this program in another finer way?
Is it possible to reserve memory in variables?

Thank you
Post 21 Jul 2005, 08:46
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8354
Location: Kraków, Poland
Tomasz Grysztar 21 Jul 2005, 08:51
You can set the stack up also this way:
Code:
SEGMENT _Stack
DB 100h DUP 0

STACK _Stack:100h-2    
Post 21 Jul 2005, 08:51
View user's profile Send private message Visit poster's website 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.