Overview
Opcode:0x6A
Introduced: Frontier (EVM genesis)
PUSH11 pushes a 11-byte immediate value from the bytecode onto the stack. The 11 bytes immediately following the opcode are read and zero-padded to 256 bits.
Specification
Stack Input:Behavior
PUSH11 reads 11 bytes from bytecode starting at positionpc + 1, interprets them as a big-endian unsigned integer, and pushes the result onto the stack.
Key characteristics:
- Reads exactly 11 bytes following opcode
- Big-endian byte order (most significant byte first)
- Zero-padded to 256 bits if less than 32 bytes
- InvalidOpcode if insufficient bytecode remaining
- PC advances by 12 (opcode + data)
Examples
Basic Usage
Solidity Compilation
Assembly Usage
Gas Cost
Cost: 3 gas (GasFastestStep) All PUSH1-32 instructions cost the same despite different data sizes. Bytecode size impact:- PUSH11: 12 bytes (1 opcode + 11 data)
- PUSH32: 33 bytes (1 opcode + 32 data)
| Opcode | Gas | Bytes | Use Case |
|---|---|---|---|
| PUSH0 | 2 | 1 | Zero constant (Shanghai+) |
| PUSH1 | 3 | 2 | Small numbers (0-255) |
Common Usage
11-Byte Constants
Big-Endian Encoding
Implementation
- TypeScript
Edge Cases
Insufficient Bytecode
Stack Overflow
Out of Gas
Maximum Value
References
- Yellow Paper - Section 9.4.1 (PUSH)
- EVM Codes - PUSH11
- Solidity Assembly - push11

