flat assembler
Message board for the users of flat assembler.

 Index > Main > Stack in Pmode
Author
othername

Joined: 08 Apr 2005
Posts: 26
Location: Lithuania
othername
Is it true that stack grows up from base+limit (in descriptor)
and ALWAYS have a size 0xFFFF (if flag B=0) or 0xFFFFFFFF (if flag B=1)[/b][/i]

_________________
08 Apr 2005, 19:18
bubach

Joined: 17 Sep 2004
Posts: 341
Location: TrollhÃ¤ttan, Sweden
bubach
the stack grows down... and it can be set to whatever you want.
08 Apr 2005, 22:12
MazeGen

Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
You can also see limit 0xFFFF with B=1 under win9x or winme. It means (in theory) that the stack can grow down between maximal offset and limit (0xFFFFFFFF -> 0xFFFF)
09 Apr 2005, 07:05
othername

Joined: 08 Apr 2005
Posts: 26
Location: Lithuania
othername
then if b=0 it is BASE+LIMIT -----[stack gr. down]-------> BASE
if b=1 it is BASE+0xFFFFFFFF -----[stack gr. down] ----> 0xFFFFFFFF-LIMIT

?

_________________
09 Apr 2005, 08:59
othername

Joined: 08 Apr 2005
Posts: 26
Location: Lithuania
othername
oh, my mistake:

if b=1 it is BASE+0xFFFFFFFF -----[stack gr. down] -----> BASE+0xFFFFFFFF-LIMIT
?
09 Apr 2005, 09:01
MazeGen

Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
Well, bit B (Big) has meaning only when ED=1. ED=1 (Expand Down) means you can access the area between maximal offset (0xFFFF if B=0, 0xFFFFFFFF if B=1) and limit, ED=0 means you can access area between 0x0 and limit.

So if ED=1 and B=1 then the stack grows down between BASE+0xFFFFFFFF -> BASE+limit.

For instance, under my winme is it between BASE+0xFFFFFFFF -> 0xFFFF. The area between 0x0 and 0xFFFF is forbidden probably because of trapping NULL-pointers.
09 Apr 2005, 18:47
othername

Joined: 08 Apr 2005
Posts: 26
Location: Lithuania
othername
which bit is DE?
can look here:
http://www.wasm.ru/article.php?article=pipm02

_________________
09 Apr 2005, 19:38
MazeGen

Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen
I don't know russian. On the picture is only segment descriptor in general, you can't see access right there.
The access rights are 8 bits, starting with bit 8 in high dword of segment descriptor. The format of the access rights vary between data, code and system decriptor. The bit ED is bit 2 in data segment access rights field.
You better read the Intel system programming manual.
09 Apr 2005, 20:44
othername

Joined: 08 Apr 2005
Posts: 26
Location: Lithuania
othername
thank you anyway

_________________
09 Apr 2005, 20:51
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First

 Jump to: Select a forum Official----------------AssemblyPeripheria General----------------MainTutorials and ExamplesDOSWindowsLinuxUnixMenuetOS Specific----------------MacroinstructionsOS ConstructionIDE DevelopmentProjects and IdeasNon-x86 architecturesHigh Level LanguagesProgramming Language DesignCompiler Internals Other----------------FeedbackHeapTest Area

Forum Rules:
 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum