flat assembler
Message board for the users of flat assembler.

Index > DOS > inital SS:SP value in MZ

Author
Thread Post new topic Reply to topic
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 27 Feb 2006, 11:09
what is SS:SP value, when no stack is reserved in header (no "stack 100h")?
Post 27 Feb 2006, 11:09
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 8356
Location: Kraków, Poland
Tomasz Grysztar 27 Feb 2006, 13:38
From section 2.4.1:
Quote:
"stack" directive sets up the stack for MZ executable. It can be followed by numerical expression specifying the size of stack to be created automatically or by the far address of initial stack frame when you want to set up the stack manually. When no stack is defined, the stack of default size 4096 bytes will be created.
Post 27 Feb 2006, 13:38
View user's profile Send private message Visit poster's website Reply with quote
vid
Verbosity in development


Joined: 05 Sep 2003
Posts: 7105
Location: Slovakia
vid 28 Feb 2006, 00:36
oh... and what happens at "stack 0"? is ss:sp just pointer to some invalid area?
Post 28 Feb 2006, 00:36
View user's profile Send private message Visit poster's website AIM Address MSN Messenger ICQ Number Reply with quote
Filter



Joined: 08 Oct 2006
Posts: 67
Filter 26 Oct 2006, 01:15
vid wrote:
oh... and what happens at "stack 0"? is ss:sp just pointer to some invalid area?


Don't EXE files require a stack of some sort? Maybe "stack 0" provides enough for it.
Post 26 Oct 2006, 01:15
View user's profile Send private message Reply with quote
Goplat



Joined: 15 Sep 2006
Posts: 181
Goplat 26 Oct 2006, 01:42
fasm does not allow "stack 0", but if you put a 0 in the SP field of the header the stack pointer does indeed start at 0. Of course, it would wrap around when you used it, and if not enough extra memory was allocated for a 64kB stack you would be overwriting some stuff in memory.
Post 26 Oct 2006, 01: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.