pop
Pop from stack
Loads BC, DE, HL, AF, IX or IY from the stack, incrementing SP once for each byte.
Used in
- The stack, push and popZ80 assembly
- call, ret and passing valuesZ80 assembly
- Interrupts: im, ei, di and haltZ80 assembly
- Stack arguments and a stack frameZ80 assembly
- Recursion: factorial and FibonacciZ80 assembly
- Binary searchZ80 assembly
- A 2D arrayZ80 assembly
- Read two numbers and print their sumZ80 assembly
- Flappy ASMZ80 assembly
SZHP/VNC ––––––
- Most forms leave every flag unchanged
Forms that affect the flags differently are shown in their row.
Forms
-
Loads the value pointed to by SP into the low byte of
rrand increments SP, then loads the value pointed to by SP into the high byte ofrrand increments SP again. pop af1 byte10 cycles S●Z●H●P/V●N●C●Loads the value pointed to by SP into F and increments SP, then loads the value pointed to by SP into A and increments SP again.
-
Loads the value pointed to by SP into IXL and increments SP, then loads the value pointed to by SP into IXH and increments SP again.
Operands
rr- A register pair:
bc,deorhl. ix- The
ixindex register. You can also useiy, with the same instruction size and timing. More
.org 0x8000
ld bc, 0x1234
push bc
pop bc
halt