> ## Documentation Index
> Fetch the complete documentation index at: https://voltaire.tevm.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# isPush()

> Check if opcode is PUSH0-PUSH32

<Card title="Try it Live" icon="play" href="https://playground.tevm.sh?example=primitives/opcode.ts">
  Run Opcode examples in the interactive playground
</Card>

## Opcode.isPush()

Check if opcode is PUSH0-PUSH32.

<Tabs>
  <Tab title="Functional API">
    ```typescript theme={null}
    import { isPush, PUSH1, ADD } from 'tevm/Opcode'

    isPush(PUSH1)  // true
    isPush(ADD)    // false
    ```
  </Tab>
</Tabs>

## Parameters

* `opcode: BrandedOpcode` - Opcode to check

## Returns

`boolean` - True if PUSH0-PUSH32 (0x5F-0x7F)

## PUSH Opcodes

* **PUSH0** (0x5F): Push 0 onto stack (no immediate data)
* **PUSH1** (0x60): Push 1 byte
* **PUSH2-PUSH31** (0x61-0x7E): Push 2-31 bytes
* **PUSH32** (0x7F): Push 32 bytes

## Use Cases

### Extract Constants

```typescript theme={null}
function extractPushValues(bytecode: Uint8Array): bigint[] {
  const instructions = Opcode.parse(bytecode)
  const values: bigint[] = []

  for (const inst of instructions) {
    if (Opcode.isPush(inst.opcode) && inst.immediate) {
      const hex = '0x' + Array(inst.immediate)
        .map(b => b.toString(16).padStart(2, '0'))
        .join('')
      values.push(BigInt(hex))
    }
  }

  return values
}
```

### Count PUSH Operations

```typescript theme={null}
function countPushOps(bytecode: Uint8Array): number {
  const instructions = Opcode.parse(bytecode)
  return instructions.filter(inst => Opcode.isPush(inst.opcode)).length
}
```

## Related

* [pushBytes()](/primitives/opcode/push-bytes) - Get PUSH data length
* [pushOpcode()](/primitives/opcode/push-opcode) - Get PUSH opcode for length
