Explore the series

Building an EVM from scratch part 1 - the execution context

Building an EVM from scratch part 2 - branching instructions

Building an EVM from scratch part 3 - calldata and the function dispatcher

🟩🟩🟩🟩🟩🟨⬜⬜⬜⬜ 77/142 instructions implemented

Github branch: smol-evm/evm-from-scratch-pt2


Introduction

In this part, we’re going to expand on our instruction set with a focus on:

Let’s go!

Branching Instructions

These instructions let us manipulate the program counter, i.e. the position in the code buffer of the next instruction to run. The spec is fairly straightforward: