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 birdZ80 assembly
SZHP/VNC ––––––
- Changes no flag
Forms
-
SP is decremented and the high byte of
rris stored into the memory location pointed to by SP. SP is decremented again and the low byte ofrris stored into the memory location pointed to by SP. -
SP is decremented and IXH is stored into the memory location pointed to by SP. SP is decremented again and IXL is stored into the memory location pointed to by SP.
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