# `push`

[Z80 Documentation](https://asm-editor.specy.app/documentation/z80.md) › [Instructions](https://asm-editor.specy.app/documentation/z80/instruction.md)

Web page: https://asm-editor.specy.app/documentation/z80/instruction/push

**Push onto stack**

Category: Stack

Stores BC, DE, HL, AF, IX or IY on the stack, decrementing SP once for each byte.

Used in: [The stack, push and pop](https://asm-editor.specy.app/learn/courses/z80/think-in-assembly/the-stack-push-and-pop.md) (Z80 assembly), [call, ret and passing values](https://asm-editor.specy.app/learn/courses/z80/think-in-assembly/call-ret-and-passing-values.md) (Z80 assembly), [Interrupts: im, ei, di and halt](https://asm-editor.specy.app/learn/courses/z80/talking-to-the-outside-world/interrupts-im-ei-di-and-halt.md) (Z80 assembly), [Stack arguments and a stack frame](https://asm-editor.specy.app/learn/courses/z80/examples/subroutine-with-stack-arguments.md) (Z80 assembly), [Recursion: factorial and Fibonacci](https://asm-editor.specy.app/learn/courses/z80/examples/factorial-and-fibonacci.md) (Z80 assembly), [Binary search](https://asm-editor.specy.app/learn/courses/z80/examples/binary-search.md) (Z80 assembly), [A 2D array](https://asm-editor.specy.app/learn/courses/z80/examples/two-dimensional-array.md) (Z80 assembly), [Read two numbers and print their sum](https://asm-editor.specy.app/learn/courses/z80/examples/sum-of-two-numbers.md) (Z80 assembly), [Flappy ASM](https://asm-editor.specy.app/learn/courses/z80/examples/flappy-asm.md) (Z80 assembly)

## Flags

| Flag | Effect |
| --- | --- |
| S | not changed |
| Z | not changed |
| H | not changed |
| P/V | not changed |
| N | not changed |
| C | not changed |

## Forms

- `push rr` · 1 byte · 11 cycles · Decrements SP and stores the high byte of `rr` into the memory location pointed to by SP, then decrements SP again and stores the low byte of `rr` there.
  - `push bc`
  - `push de`
  - `push hl`
  - `push af`

- `push ix` · 2 bytes · 15 cycles · Decrements SP and stores IXH into the memory location pointed to by SP, then decrements SP again and stores IXL there.
  - `push ix`
  - `push iy`

## Operands

- `rr`: A register pair: `bc`, `de`, `hl` or `af`.
- [`ix`](https://asm-editor.specy.app/documentation/z80/registers/register-ix.md): The `ix` index register. You can also use `iy`, with the same instruction size and timing.

## Example

```z80
        .org 0x8000
        ld bc, 0x0234
        push bc
        halt
```
