Page 1 of 1
Stacks... how to and that sort of stuff...
Posted: Sat Aug 25, 2001 12:36 pm
by Peter_Vigren
Hi, does anyone know how I specify where the stack begins? It should have something to do with SS however I'm not completely sure... And when you push something to the stack, where is it stored and in what order?
In other words... I want to know all you know about the stack... plain and simple...
Re: Stacks... how to and that sort of stuff...
Posted: Sat Aug 25, 2001 8:46 pm
by Kenneth Garin
Stacks grow down and there are two registers that control where the stack begins, there is the SP (stack pointer) and SS (stack segment). Im not sure if this information is valid for pmode so someone correct me if im wrong please
The SP is basicly the offset of the stack and SS is the segment so if you were to...
MOV AX,segment
MOV SS,AX
MOV AX,offset
MOV SP,AX
The thing you MUST remember is that stacks grow down, not up so if you pushed 2 bytes on the stack it would move the SP or SS down by two bytes.
Hope this helps, KG.
Re: Stacks... how to and that sort of stuff...
Posted: Sun Aug 26, 2001 9:56 pm
by def
I think in pmode its the same. The only difference is that ss is now a segement descriptor and you have to deal with esp ...