You are on page 1of 3

Stack and its Operation

The stack is an area of memory identified by the programmer for temporary


storage of information.

• The stack is a LIFO structure (Last In First Out)

• The stack normally grows backwards into memory. ( In other words, the
programmer defines the bottom of the stack and the stack grows up into reducing
address range )

 The Size of the stack is limited only by the available memory.

.stack100h [it is directive/command that reserves 100h bytes for stack]

Operation
 PUSH

o PushA
Push all general purpose registers AX, BX ,CX, DX, SP, BP, SI, DI in the
stack. Original value of SP register (before PUSHA) is used.
o PushF
It has no operand and it pushes the content of FLAG register onto the
stack.
Usually this is done whenever the processor is interrupted
Syntax: PUSHF

 POP

o PopA
Pop all general purpose registers DI, SI, BP, SP, BX, DX, CX, AX from the
stack. SP value is ignored, it is Popped but not set to SP register).

o PopF
It has no operand and pops the top of the stack into FLAG register.
SP is incremented by 2 after executing this instant.
Syntax: POPF

You might also like