push
Push onto stack
Stores BC, DE, HL, AF, IX or IY on the stack, decrementing 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 ––––––
- Leaves every flag unchanged
Forms
-
Decrements SP and stores the high byte of
rrinto the memory location pointed to by SP, then decrements SP again and stores the low byte ofrrthere. -
Decrements SP and stores IXH into the memory location pointed to by SP, then decrements SP again and stores IXL there.
Operands
rr- A register pair:
bc,de,hloraf. ix- The
ixindex register. You can also useiy, with the same instruction size and timing. More
.org 0x8000
ld bc, 0x0234
push bc
halt