
HT80C51 User Manual
80C51 Family Instruction Set – Instruction definitions
Handshake Solutions
© Philips Electronics N.V. 2005
Page 121 of 132
POP direct
Function: Pop from stack
Description: The contents of the internal RAM location addressed by the Stack Pointer is read, and the Stack
Pointer is decremented by one. The value read is then transferred to the directly addressed byte
indicated. No flags are affected.
Example: The Stack Pointer originally contains the value 32H, and internal RAM locations 30H through 32H
contain the values 20H, 23H, and 01H, respectively. The instruction sequence,
POP DPH
POP DPL
will leave the Stack Pointer equal to the value 30H and the Data Pointer set to 0123H. At this point
the instruction,
POP SP
will leave the Stack Pointer set to 20H. Note that in this special case the Stack Pointer was dec-
remented to 2FH before being loaded with the value popped (20H).
Bytes: 2
Cycles: 2
Encoding:
Operation: POP
(direct)
← ((SP))
(SP)
← (SP) – 1
PUSH direct
Function: Push onto stack
Description: The Stack Pointer is incremented by one. The contents of the indicated variable is then copied
into the internal RAM location addressed by the Stack Pointer. Otherwise no flags are affected.
Example: On entering an interrupt routine the Stack Pointer contains 09H. The Data Pointer holds the value
0123H. The instruction sequence,
PUSH DPL
PUSH DPH
will leave the Stack Pointer set to 0BH and store 23H and 01H in internal RAM locations 0AH and
0BH, respectively.
Bytes: 2
Cycles: 2
Encoding:
Operation: PUSH
(SP)
← (SP) + 1
((SP))
← (direct)
1
1
0
1
0
0
0
0
direct address
1
1
0
0
0
0
0
0
direct address