Explain PUSH and POP Instructions of 8085
USH-PUSH REGISTER PAIR ON STACK
This is a single byte instruction. The contents of the register pair specified in the operand are copied into the stack
(1) The stack pointer is decremented and the contents of higher order register in pair (such as B in BC pair, D in DE pair) are copied on stack.
(2) The stack pointer is decremented again and contents of lower order register are copied on the stack. No flags are modified. Contents of register pair are unchanged.
Will push contents of DE pair
Let D = 15 H & E = 23 H
Let SP = 2300 H
Then after executing PUSH D we will get following contents in SP and stack
POP–POP OFF STACK TO REGISTER PAIR
This is single byte instruction. On execution copies two top bytes on stack to designated register pair in operand
(1) Contents of top most location of stack called stack top are copied into lower register (such as C in BC etc) of the pair. The SP is incremented by 1.
(2) Contents of the stack location pointed by SP are copied into higher register of the pair. The stack pointer SP is incremented by 1. No flags are affected. Contents of stack are unchanged.
Consider SP = 22FE H with following contents stored on stack.
On execution of instruction POP H the contents of H, L, SP will be as shown in figure.