POP qq

Operation

qqH <- (SP+1), qqL <- (SP)

Mnemonic

POP

Operands

qq

b7b6b5b4b3b2b1b0
1 1 qq0 0 0 1

Description

The top two bytes of the external memory last-in, first-out (LIFO) stack are popped to register pair qq. The Stack Pointer (SP) Register pair holds the 16-bit address of the current top of the Stack. This instruction first loads to the low-order portion of qq, the byte at the memory location corresponding to the contents of SP; then SP is incremented and the con- tents of the corresponding adjacent memory location are loaded to the high-order portion of qq and the SP is now incremented again. The operand qq identifies register pair BC, DE, HL, or AF, assembled as follows in the object code:

RegisterddHex
BC00$C1
DE01$D1
HL10$E1
AF11$F1

Condition Bits Affected

None

Example

If the Stack Pointer contains $1000, memory location $1000 contains $55 and location $1001 contains $33, the instruction

	POP	HL

results in register pair HL containing $3355 and the Stack Pointer containing $1002.