Computer Architecture & Assembly Language Topic (Stack & Its Operations)
Computer Architecture & Assembly Language Topic (Stack & Its Operations)
Assembly Language
LX SP, FFFFH
It loads address on the Stack Pointer (SP)
This sets the Stack Pointer to location FFFFH (end of memory for
the 8085)
Saving Information on the Stack
199
200 SP
Decrement SP
Copy the contents of register AX to the memory
location pointed to by SP
Copies content from Operand to top of stack
How to take out value from Stack
We use function Pop to take out values from stack
POP Register/Variable
101
Example .
.
POP AX .
199
200 SP
Increment SP 201
PUSH B
PUSH D
...
POP D
POP B
Reversing the order of the POP instructions will result in
the exchange of the contents