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.
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.
stack segment register
To reset the pending RST 7.5 instruction in the 8085, you need to execute a SIM instruction with a particular value in the accumulator. PUSH FLAGS MVI A,10H SIM POP FLAGS Of course the PUSH and POP are optional, if you don't need to preserve the value of the accumulator.
The PUSH instruction decrements the stack pointer by the size of the operand and then stores its operand at the memory address pointed to by the stack pointer. This leaves the stack pointer always pointing to the last element pushed onto the stack.The POP instruction reverses the sequence, retrieving the operand first, and then incrementing the stack pointer by the size of the operand.Also, PUSH and POP do not work on variables - they only work on register values. You can pop/push a variable, however, by using a register and then storing/retrieving the register to/from memory.
If this is a homework assignment, you really should try to answer it on your own first, otherwise the value of the reinforcement of the lesson due to actually doing the assignment will be lost on you.The call-return and push-pop instruction sequences on the 8085 are similar in that each pushes something on the stack and then pops something off the stack.In the case of call-return, that something is the program counter. In the case of push-pop, that something is up to the programmer, and it can be one of AF, BC, DE, or HL.
If the stack is empty assume the stack pointer has a value of P. when you push something on the stack you increment P. when you pull something from stack you decrement P.
you can buy push pop sliders at any store
pop push c++ programming
Push and pop relate to sequence containers where elements can be inserted and removed from the sequence with push and pop operations, respectively. Typically, push and pop apply to one end of the sequence, but not necessarily at the same end. However, if a push or a pop can be applied to both ends of a sequence, the operations are named push_front, push_back, pop_front and pop_back. Ideally, push and pop are constant-time operations. However, depending on the container type, a push or pop at one end may be more efficient than at the other. The following is a summary of common container types and the efficiencies that can be expected: A vector supports push and pop at either end. However, push_back and pop_back are constant time operations unless a reallocation occurs (we can reserve memory at the end of the vector to minimise the need for reallocations) whereas push_front and pop_front are always linear-time operations. A forward list supports push and pop at the head of the list only, both of which are constant-time operations. A bi-directional list supports push and pop at either end, all of which are constant-time operations. A queue supports push at the back and pop at the front, both of which are constant-time operations. A deque (double-ended-queue) supports push and pop at either end, all of which are constant-time operations. A stack supports push and pop at the top of the stack, both of which are constant time operations. Note that a fixed-length array does not support push or pop operations because it cannot grow or shrink in size.
Stack/explicit.
A loop in a microprocessor, like any loop in any programming language, is a series of instructions that is executed repeatedly until some condition is satisfied. An example of a delay loop in the 8085 might be... . PUSH FLAGS . XRA A L INR A . JNZ L . POP FLAGS This piece of code, with a 1 MHz clock, will take about 4.6 mS to execute, and it will save and restore the accumulator and flags.
This is not possible as this violates the basic definition of stack...That can have only two primitive operations "Push" "POP" If u want to implement what u want u can do that by some implementation of Push pop combination but that is what other data strutures like queue do....
The POP H instruction in the 8085 copies the top of stack to the HL register and then increments the stack pointer by 2. In C pseudo code, the sequence is L = *(SP++); H = *(SP++);