I am not sure about 8086, but I can tell you the whole procedure in 8085.
PUSH instruction always pushes two bytes of data i.e. total 16 bits.
Example:
Assume that Stack is already initialized and SP is at 2008 address location. Then PUSH B instruction will have following steps:
1) The stack pointer (SP) will be pointing to the uppermost position of the stack (actually stack works in opposite order in terms of Addresses. e.g. if SP is now at address 2008, then PUSH instruction will store the contents on 2007 & 2006).
2) The contents of register B & C will be saved on to the stack such that contents of register B will be at 2007 & that of C will be at 2006 address location.
3) The SP is now modified to 2006.
Chat with our AI personalities
The 8086/8088 uses a stack pointer that points to the last pushed data on the stack, or to the last address + 1 of an unused stack.
When you push something on the stack, the stack pointer is decremented by 2 and the data is written at that address.
When you pop something off the stack, the data is read from the address and then the stack pointer is incremented by 2.
Note that the sequence is important. On push we decrement and store - On pop we read and THEN increment.
Pushing is akin to stacking papers on your desk on top of each other. You are working on the one on top. You want to do something else, so you put another on top and work on that. When you are done, you take the top off, put it away, and continue working on the first. This can be nested, arbitrarily deep, so long as you have sufficient memory. Just remember that the stack is backwards in memory, growing from top down.
You can explicitly push/pop with the push/pop instructions, or you can implicitly push/pop with the call/ret and int/iret instructions.