stack
Stack Machine Model
Understanding the LIFO architecture.
The EVM uses a Last-In, First-Out (LIFO) stack to store small pieces of data needed for operations. The stack can hold up to 1024 items, each 256 bits wide. Most opcodes work by popping one or more items from the top, performing a calculation, and pushing the result back. For example, ADD pops two numbers and pushes their sum.
Execution Simulation
Assistant Note
"Currently at PUSH instruction. It's going to place a value on top of the stack."
Program
5 bytesStack
LIFO0 / 1024
Memory
0 bytes00-0708-1516-2324-31
Gas Meter
Consumed0 / 1,000,000
Last Op Cost
-0
Refund
0
* Gas prevents infinite loops and DDoS. SSTORE is the most expensive opcode (20,000 gas for new slots).