1.What was your learning from this experiment module?
Ans:
In this experiment I became familiar with stack operations. I learned how data are stored and removed from stack memory. In Stack operation I learned to holds the data temporarily and stores the return addresses. Learned how data are stored into the stack with a PUSH instruction and removed with a POP instruction. Learnd about the CALL instruction. Learned about Stack Pointer (SP) and Stack Segment (SS)
2.why we use stack segment?
Ans:
The stack segment register (SS) is usually used to store information about the memory segment that stores the call stack of currently executed program. In assembly language programming we have only four registers with which we can perform operations. These are AX, BX, CX and DX. But in many problems we may need a lot of registers. So we need to reuse these registers again and again. This can be done by storing present value of a register (suppose AX) in stack segment. Now we can perform other tasks with AX. This will certainly change content of AX. After this getting the value of AX from stack and restoring its previous value. The first job (storing value of AX in stack) is done by PUSH command. Second job (restoring value of AX from stack) is done by POP command in assembly language.