---
title: Codici operativi (opcode) per l'EVM
description: Un elenco di tutti i codici operativi (opcode) disponibili per la macchina virtuale di Ethereum.
lang: it
---

## Panoramica

Questa è una versione aggiornata della pagina di riferimento dell'EVM su [wolflo/evm-opcodes](https://github.com/wolflo/evm-opcodes).
Tratta anche dallo [yellow paper](https://ethereum.github.io/yellowpaper/paper.pdf), dal [Jello Paper](https://jellopaper.org/evm/) e dall'implementazione di [geth](https://github.com/ethereum/go-ethereum).
Vuole essere un riferimento accessibile, ma non è particolarmente rigoroso.
Se si desidera avere la certezza della correttezza ed essere a conoscenza di ogni caso limite, è consigliabile utilizzare il Jello Paper o l'implementazione di un client.

Cerchi un riferimento interattivo? Dai un'occhiata a [evm.codes](https://www.evm.codes/).

Per le operazioni con costi del gas dinamici, consulta [gas.md](https://github.com/wolflo/evm-opcodes/blob/main/gas.md).

💡 Suggerimento rapido: per visualizzare le righe intere, usa `[shift] + scroll` per scorrere orizzontalmente su desktop.

<WideTable>

| Stack | Nome | Gas | Stack iniziale | Stack risultante | Mem / Storage | Note |
| :---: | :------------- | :---------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------- | :------------------------------ | :---------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------- |
| 00 | STOP | 0 | | | | interrompe l'esecuzione |
| 01 | ADD | 3 | `a, b` | `a + b` | | addizione (u)int256 modulo 2\*\*256 |
| 02 | MUL | 5 | `a, b` | `a * b` | | moltiplicazione (u)int256 modulo 2\*\*256 |
| 03 | SUB | 3 | `a, b` | `a - b` | | sottrazione (u)int256 modulo 2\*\*256 |
| 04 | DIV | 5 | `a, b` | `a // b` | | divisione uint256 |
| 05 | SDIV | 5 | `a, b` | `a // b` | | divisione int256 |
| 06 | MOD | 5 | `a, b` | `a % b` | | modulo uint256 |
| 07 | SMOD | 5 | `a, b` | `a % b` | | modulo int256 |
| 08 | ADDMOD | 8 | `a, b, N` | `(a + b) % N` | | addizione (u)int256 modulo N |
| 09 | MULMOD | 8 | `a, b, N` | `(a * b) % N` | | moltiplicazione (u)int256 modulo N |
| 0A | EXP | [A1](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a1-exp) | `a, b` | `a ** b` | | esponenziazione uint256 modulo 2\*\*256 |
| 0B | SIGNEXTEND | 5 | `b, x` | `SIGNEXTEND(x, b)` | | [estensione del segno](https://wikipedia.org/wiki/Sign_extension) di `x` da `(b+1)` byte a 32 byte |
| 0C-0F | _non valido_ |
| 10 | LT | 3 | `a, b` | `a < b` | | minore di uint256 |
| 11 | GT | 3 | `a, b` | `a > b` | | maggiore di uint256 |
| 12 | SLT | 3 | `a, b` | `a < b` | | minore di int256 |
| 13 | SGT | 3 | `a, b` | `a > b` | | maggiore di int256 |
| 14 | EQ | 3 | `a, b` | `a == b` | | uguaglianza (u)int256 |
| 15 | ISZERO | 3 | `a` | `a == 0` | | iszero (u)int256 |
| 16 | AND | 3 | `a, b` | `a && b` | | AND bit a bit |
| 17 | OR | 3 | `a, b` | `a \|\| b` | | OR bit a bit |
| 18 | XOR | 3 | `a, b` | `a ^ b` | | XOR bit a bit |
| 19 | NOT | 3 | `a` | `~a` | | NOT bit a bit |
| 1A | BYTE | 3 | `i, x` | `(x >> (248 - i * 8)) && 0xFF` | | `i`-esimo byte di (u)int256 `x`, da sinistra |
| 1B | SHL | 3 | `shift, val` | `val << shift` | | scorrimento a sinistra |
| 1C | SHR | 3 | `shift, val` | `val >> shift` | | scorrimento logico a destra |
| 1D | SAR | 3 | `shift, val` | `val >> shift` | | scorrimento aritmetico a destra |
| 1E-1F | _non valido_ |
| 20 | KECCAK256 | [A2](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a2-sha3) | `ost, len` | `keccak256(mem[ost:ost+len-1])` | | keccak256 |
| 21-2F | _non valido_ |
| 30 | ADDRESS | 2 | `.` | `address(this)` | | indirizzo del contratto in esecuzione |
| 31 | BALANCE | [A5](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a5-balance-extcodesize-extcodehash) | `addr` | `addr.balance` | | saldo, in Wei |
| 32 | ORIGIN | 2 | `.` | `tx.origin` | | indirizzo che ha originato la transazione |
| 33 | CALLER | 2 | `.` | `msg.sender` | | indirizzo del mittente del msg |
| 34 | CALLVALUE | 2 | `.` | `msg.value` | | valore del msg, in Wei |
| 35 | CALLDATALOAD | 3 | `idx` | `msg.data[idx:idx+32]` | | legge una word dai dati del msg all'indice `idx` |
| 36 | CALLDATASIZE | 2 | `.` | `len(msg.data)` | | lunghezza dei dati del msg, in byte |
| 37 | CALLDATACOPY | [A3](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a3-copy-operations) | `dstOst, ost, len` | `.` | mem[dstOst:dstOst+len-1] := msg.data[ost:ost+len-1] | copia i dati del msg |
| 38 | CODESIZE | 2 | `.` | `len(this.code)` | | lunghezza del codice del contratto in esecuzione, in byte |
| 39 | CODECOPY | [A3](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a3-copy-operations) | `dstOst, ost, len` | `.` | | mem[dstOst:dstOst+len-1] := this.code[ost:ost+len-1] | copia il bytecode del contratto in esecuzione |
| 3A | GASPRICE | 2 | `.` | `tx.gasprice` | | prezzo del gas della transazione, in Wei per unità di gas [\*\*](https://eips.ethereum.org/EIPS/eip-1559#gasprice) |
| 3B | EXTCODESIZE | [A5](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a5-balance-extcodesize-extcodehash) | `addr` | `len(addr.code)` | | dimensione del codice all'indirizzo addr, in byte |
| 3C | EXTCODECOPY | [A4](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a4-extcodecopy) | `addr, dstOst, ost, len` | `.` | mem[dstOst:dstOst+len-1] := addr.code[ost:ost+len-1] | copia il codice da `addr` |
| 3D | RETURNDATASIZE | 2 | `.` | `size` | | dimensione dei dati restituiti dall'ultima chiamata esterna, in byte |
| 3E | RETURNDATACOPY | [A3](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a3-copy-operations) | `dstOst, ost, len` | `.` | mem[dstOst:dstOst+len-1] := returndata[ost:ost+len-1] | copia i dati restituiti dall'ultima chiamata esterna |
| 3F | EXTCODEHASH | [A5](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a5-balance-extcodesize-extcodehash) | `addr` | `hash` | | hash = addr.exists ? keccak256(addr.code) : 0 |
| 40 | BLOCKHASH | 20 | `blockNum` | `blockHash(blockNum)` | |
| 41 | COINBASE | 2 | `.` | `block.coinbase` | | indirizzo del proponente del blocco corrente |
| 42 | TIMESTAMP | 2 | `.` | `block.timestamp` | | timestamp del blocco corrente |
| 43 | NUMBER | 2 | `.` | `block.number` | | numero del blocco corrente |
| 44 | PREVRANDAO | 2 | `.` | `randomness beacon` | | beacon di casualità |
| 45 | GASLIMIT | 2 | `.` | `block.gaslimit` | | limite di gas del blocco corrente |
| 46 | CHAINID | 2 | `.` | `chain_id` | | inserisce l'[ID della catena](https://eips.ethereum.org/EIPS/eip-155) corrente nello stack |
| 47 | SELFBALANCE | 5 | `.` | `address(this).balance` | | saldo del contratto in esecuzione, in Wei |
| 48 | BASEFEE | 2 | `.` | `block.basefee` | | commissione di base del blocco corrente |
| 49 | BLOBHASH | 3 | `idx` | `tx.blob_versioned_hashes[idx]` | | [EIP-4844](https://eips.ethereum.org/EIPS/eip-4844) |
| 4A | BLOBBASEFEE | 2 | `.` | `block.blobbasefee` | | commissione di base del blob del blocco corrente ([EIP-7516](https://eips.ethereum.org/EIPS/eip-7516)) |
| 4B-4F | _non valido_ |
| 50 | POP | 2 | `_anon` | `.` | | rimuove l'elemento dalla cima dello stack e lo scarta |
| 51 | MLOAD | 3[\*](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion) | `ost` | `mem[ost:ost+32]` | | legge una word dalla memoria all'offset `ost` |
| 52 | MSTORE | 3[\*](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion) | `ost, val` | `.` | mem[ost:ost+32] := val | scrive una word in memoria |
| 53 | MSTORE8 | 3[\*](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion) | `ost, val` | `.` | mem[ost] := val && 0xFF | scrive un singolo byte in memoria |
| 54 | SLOAD | [A6](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a6-sload) | `key` | `storage[key]` | | legge una word dallo storage |
| 55 | SSTORE | [A7](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a7-sstore) | `key, val` | `.` | storage[key] := val | scrive una word nello storage |
| 56 | JUMP | 8 | `dst` | `.` | | `$pc := dst` indica che `pc` viene assegnato solo se `dst` è una destinazione di salto valida |
| 57 | JUMPI | 10 | `dst, condition` | `.` | | `$pc := condition ? dst : $pc + 1` |
| 58 | PC | 2 | `.` | `$pc` | | program counter |
| 59 | MSIZE | 2 | `.` | `len(mem)` | | dimensione della memoria nel contesto di esecuzione corrente, in byte |
| 5A | GAS | 2 | `.` | `gasRemaining` | |
| 5B | JUMPDEST | 1 | | | contrassegna una destinazione di salto valida | una destinazione di salto valida, ad esempio una destinazione di salto non all'interno dei dati di push |
| 5C | TLOAD | 100 | `key` | `tstorage[key]` | | legge una word dallo storage transitorio ([EIP-1153](https://eips.ethereum.org/EIPS/eip-1153)) |
| 5D | TSTORE | 100 | `key, val` | `.` | tstorage[key] := val | scrive una word nello storage transitorio ([EIP-1153](https://eips.ethereum.org/EIPS/eip-1153)) |
| 5E | MCOPY | 3+3\*words+[A0](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion) | `dstOst, ost, len` | `.` | mem[dstOst] := mem[ost:ost+len] | copia la memoria da un'area all'altra ([EIP-5656](https://eips.ethereum.org/EIPS/eip-5656)) |
| 5F | PUSH0 | 2 | `.` | `uint8` | | inserisce il valore costante 0 nello stack |
| 60 | PUSH1 | 3 | `.` | `uint8` | | inserisce un valore di 1 byte nello stack |
| 61 | PUSH2 | 3 | `.` | `uint16` | | inserisce un valore di 2 byte nello stack |
| 62 | PUSH3 | 3 | `.` | `uint24` | | inserisce un valore di 3 byte nello stack |
| 63 | PUSH4 | 3 | `.` | `uint32` | | inserisce un valore di 4 byte nello stack |
| 64 | PUSH5 | 3 | `.` | `uint40` | | inserisce un valore di 5 byte nello stack |
| 65 | PUSH6 | 3 | `.` | `uint48` | | inserisce un valore di 6 byte nello stack |
| 66 | PUSH7 | 3 | `.` | `uint56` | | inserisce un valore di 7 byte nello stack |
| 67 | PUSH8 | 3 | `.` | `uint64` | | inserisce un valore di 8 byte nello stack |
| 68 | PUSH9 | 3 | `.` | `uint72` | | inserisce un valore di 9 byte nello stack |
| 69 | PUSH10 | 3 | `.` | `uint80` | | inserisce un valore di 10 byte nello stack |
| 6A | PUSH11 | 3 | `.` | `uint88` | | inserisce un valore di 11 byte nello stack |
| 6B | PUSH12 | 3 | `.` | `uint96` | | inserisce un valore di 12 byte nello stack |
| 6C | PUSH13 | 3 | `.` | `uint104` | | inserisce un valore di 13 byte nello stack |
| 6D | PUSH14 | 3 | `.` | `uint112` | | inserisce un valore di 14 byte nello stack |
| 6E | PUSH15 | 3 | `.` | `uint120` | | inserisce un valore di 15 byte nello stack |
| 6F | PUSH16 | 3 | `.` | `uint128` | | inserisce un valore di 16 byte nello stack |
| 70 | PUSH17 | 3 | `.` | `uint136` | | inserisce un valore di 17 byte nello stack |
| 71 | PUSH18 | 3 | `.` | `uint144` | | inserisce un valore di 18 byte nello stack |
| 72 | PUSH19 | 3 | `.` | `uint152` | | inserisce un valore di 19 byte nello stack |
| 73 | PUSH20 | 3 | `.` | `uint160` | | inserisce un valore di 20 byte nello stack |
| 74 | PUSH21 | 3 | `.` | `uint168` | | inserisce un valore di 21 byte nello stack |
| 75 | PUSH22 | 3 | `.` | `uint176` | | inserisce un valore di 22 byte nello stack |
| 76 | PUSH23 | 3 | `.` | `uint184` | | inserisce un valore di 23 byte nello stack |
| 77 | PUSH24 | 3 | `.` | `uint192` | | inserisce un valore di 24 byte nello stack |
| 78 | PUSH25 | 3 | `.` | `uint200` | | inserisce un valore di 25 byte nello stack |
| 79 | PUSH26 | 3 | `.` | `uint208` | | inserisce un valore di 26 byte nello stack |
| 7A | PUSH27 | 3 | `.` | `uint216` | | inserisce un valore di 27 byte nello stack |
| 7B | PUSH28 | 3 | `.` | `uint224` | | inserisce un valore di 28 byte nello stack |
| 7C | PUSH29 | 3 | `.` | `uint232` | | inserisce un valore di 29 byte nello stack |
| 7D | PUSH30 | 3 | `.` | `uint240` | | inserisce un valore di 30 byte nello stack |
| 7E | PUSH31 | 3 | `.` | `uint248` | | inserisce un valore di 31 byte nello stack |
| 7F | PUSH32 | 3 | `.` | `uint256` | | inserisce un valore di 32 byte nello stack |
| 80 | DUP1 | 3 | `a` | `a, a` | | clona il 1° valore nello stack |
| 81 | DUP2 | 3 | `_, a` | `a, _, a` | | clona il 2° valore nello stack |
| 82 | DUP3 | 3 | `_, _, a` | `a, _, _, a` | | clona il 3° valore nello stack |
| 83 | DUP4 | 3 | `_, _, _, a` | `a, _, _, _, a` | | clona il 4° valore nello stack |
| 84 | DUP5 | 3 | `..., a` | `a, ..., a` | | clona il 5° valore nello stack |
| 85 | DUP6 | 3 | `..., a` | `a, ..., a` | | clona il 6° valore nello stack |
| 86 | DUP7 | 3 | `..., a` | `a, ..., a` | | clona il 7° valore nello stack |
| 87 | DUP8 | 3 | `..., a` | `a, ..., a` | | clona l'8° valore nello stack |
| 88 | DUP9 | 3 | `..., a` | `a, ..., a` | | clona il 9° valore nello stack |
| 89 | DUP10 | 3 | `..., a` | `a, ..., a` | | clona il 10° valore nello stack |
| 8A | DUP11 | 3 | `..., a` | `a, ..., a` | | clona l'11° valore nello stack |
| 8B | DUP12 | 3 | `..., a` | `a, ..., a` | | clona il 12° valore nello stack |
| 8C | DUP13 | 3 | `..., a` | `a, ..., a` | | clona il 13° valore nello stack |
| 8D | DUP14 | 3 | `..., a` | `a, ..., a` | | clona il 14° valore nello stack |
| 8E | DUP15 | 3 | `..., a` | `a, ..., a` | | clona il 15° valore nello stack |
| 8F | DUP16 | 3 | `..., a` | `a, ..., a` | | clona il 16° valore nello stack |
| 90 | SWAP1 | 3 | `a, b` | `b, a` | |
| 91 | SWAP2 | 3 | `a, _, b` | `b, _, a` | |
| 92 | SWAP3 | 3 | `a, _, _, b` | `b, _, _, a` | |
| 93 | SWAP4 | 3 | `a, _, _, _, b` | `b, _, _, _, a` | |
| 94 | SWAP5 | 3 | `a, ..., b` | `b, ..., a` | |
| 95 | SWAP6 | 3 | `a, ..., b` | `b, ..., a` | |
| 96 | SWAP7 | 3 | `a, ..., b` | `b, ..., a` | |
| 97 | SWAP8 | 3 | `a, ..., b` | `b, ..., a` | |
| 98 | SWAP9 | 3 | `a, ..., b` | `b, ..., a` | |
| 99 | SWAP10 | 3 | `a, ..., b` | `b, ..., a` | |
| 9A | SWAP11 | 3 | `a, ..., b` | `b, ..., a` | |
| 9B | SWAP12 | 3 | `a, ..., b` | `b, ..., a` | |
| 9C | SWAP13 | 3 | `a, ..., b` | `b, ..., a` | |
| 9D | SWAP14 | 3 | `a, ..., b` | `b, ..., a` | |
| 9E | SWAP15 | 3 | `a, ..., b` | `b, ..., a` | |
| 9F | SWAP16 | 3 | `a, ..., b` | `b, ..., a` | |
| A0 | LOG0 | [A8](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a8-log-operations) | `ost, len` | `.` | | LOG0(memory[ost:ost+len-1]) |
| A1 | LOG1 | [A8](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a8-log-operations) | `ost, len, topic0` | `.` | | LOG1(memory[ost:ost+len-1], topic0) |
| A2 | LOG2 | [A8](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a8-log-operations) | `ost, len, topic0, topic1` | `.` | | LOG2(memory[ost:ost+len-1], topic0, topic1) |
| A3 | LOG3 | [A8](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a8-log-operations) | `ost, len, topic0, topic1, topic2` | `.` | | LOG3(memory[ost:ost+len-1], topic0, topic1, topic2) |
| A4 | LOG4 | [A8](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a8-log-operations) | `ost, len, topic0, topic1, topic2, topic3` | `.` | | LOG4(memory[ost:ost+len-1],&#160;topic0,&#160;topic1,&#160;topic2,&#160;topic3) |
| A5-EF | _non valido_ |
| F0 | CREATE | [A9](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a9-create-operations) | `val, ost, len` | `addr` | | addr = keccak256(rlp([address(this), this.nonce])) |
| F1 | CALL | [AA](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-call-operations) | <code>gas,&#160;addr,&#160;val,&#160;argOst,&#160;argLen,&#160;retOst,&#160;retLen</code> | `success` | mem[retOst:retOst+retLen-1] := returndata |
| F2 | CALLCODE | [AA](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-call-operations) | `gas, addr, val, argOst, argLen, retOst, retLen` | `success` | mem[retOst:retOst+retLen-1]&#160;=&#160;returndata | uguale&#160;a&#160;DELEGATECALL,&#160;ma&#160;non&#160;propaga&#160;il&#160;msg.sender&#160;e&#160;il&#160;msg.value&#160;originali |
| F3 | RETURN | 0[\*](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion) | `ost, len` | `.` | | restituisce mem[ost:ost+len-1] |
| F4 | DELEGATECALL | [AA](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-call-operations) | `gas, addr, argOst, argLen, retOst, retLen` | `success` | mem[retOst:retOst+retLen-1] := returndata |
| F5 | CREATE2 | [A9](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a9-create-operations) | `val, ost, len, salt` | `addr` | | addr = keccak256(0xff ++ address(this) ++ salt ++ keccak256(mem[ost:ost+len-1]))[12:] |
| F6-F9 | _non valido_ |
| FA | STATICCALL | [AA](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#aa-call-operations) | `gas, addr, argOst, argLen, retOst, retLen` | `success` | mem[retOst:retOst+retLen-1] := returndata |
| FB-FC | _non valido_ |
| FD | REVERT | 0[\*](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#a0-1-memory-expansion) | `ost, len` | `.` | | revert(mem[ost:ost+len-1]) |
| FE | INVALID | [AF](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#af-invalid) | | | codice operativo (opcode) non valido designato - [EIP-141](https://eips.ethereum.org/EIPS/eip-141) |
| FF | SELFDESTRUCT | [AB](https://github.com/wolflo/evm-opcodes/blob/main/gas.md#ab-selfdestruct) | `addr` | `.` | | invia tutti gli ETH a `addr`; se eseguito nella stessa transazione in cui è stato creato un contratto, distrugge il contratto |

</WideTable>
