---
eip: 8013
label: EIP-8013
title: Static relative jumps and calls for the EVM
status: Draft
type: Standards Track
category: Core
created: 2025-08-19
requires: 7979
official: https://eips.ethereum.org/EIPS/eip-8013
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-8013.md
canonical: https://eips.huatuo.xyz/eip-8013/
lang: en
tldr: Adds five EVM jump instructions (RJUMP, RJUMPI, RJUMPV, RJUMPSUB, RJUMPSUBV) whose targets are fixed signed offsets in the bytecode, making control flow cheaper, faster and statically analyzable.
tags: [evm, opcode, control-flow, jumps, core]
---

# EIP-8013: Static relative jumps and calls for the EVM

> Relative jump and call instructions with a signed immediate encoding the jump destination

**TL;DR:** Adds five EVM jump instructions (RJUMP, RJUMPI, RJUMPV, RJUMPSUB, RJUMPSUBV) whose targets are fixed signed offsets in the bytecode, making control flow cheaper, faster and statically analyzable.

## What problem does it solve?

The EVM only has dynamic jumps: `JUMP` and `JUMPI` take their destination from the stack. That is flexible, but tools cannot easily tell where code can go, which makes analysis hard and sometimes intractable, and it is part of why the `JUMPDEST` marker and its runtime checks exist. In practice almost all control flow is static (loops, if/else, function calls) and does not need that flexibility.

EIP-8013 gives compilers static, relative jumps for these cases, so they can avoid `JUMP`/`JUMPI` while the old opcodes keep working for existing code.

## How it works

Each instruction carries its target in an immediate argument. Offsets are 16-bit **signed** big-endian values, relative to the PC right after the instruction and its immediate.

| Opcode | Name | Behavior |
| --- | --- | --- |
| `0xe0` | `RJUMP off` | Jump to `pc_post + off` |
| `0xe1` | `RJUMPI off` | Pop `cond`; jump if non-zero |
| `0xe2` | `RJUMPV max off…` | Pop `case`; jump to `off[case]`, or fall through if `case > max` |
| `0xe3` | `RJUMPSUB off` | Push return address to the return stack and jump to an `ENTERSUB` |
| `0xe4` | `RJUMPSUBV max off…` | Table version of `RJUMPSUB` |

- Jump tables hold `max_index + 1` offsets (up to 256); the default case sits right after the instruction.
- The subroutine forms build on [EIP-7979](/eip-7979/) (`CALLSUB`, `ENTERSUB`, `RETURNSUB`); their target **must** be an `ENTERSUB`.
- Code validation (extended from EIP-7979) ensures every target is a real instruction inside the code: not PUSH data, not another jump's immediate. Targets need no `JUMPDEST`, saving a byte at deploy time and gas per jump.
- Suggested costs: `RJUMP` 2, `RJUMPI`/`RJUMPV` 4, `RJUMPSUB`/`RJUMPSUBV` 5, compared with 8/10 for `JUMP`/`JUMPI`.

Relative addressing makes code relocatable, so a snippet can be injected anywhere. The ±32767-byte range covers the 24,576-byte code size limit ([EIP-170](/eip-170/)).

## Sample code

A countdown loop using `RJUMPI` with a negative offset (assembly with byte offsets):

```text
0x00  60 05        PUSH1 5          ; counter
0x02  60 01        PUSH1 1          ; loop body starts here
0x04  90           SWAP1
0x05  03           SUB              ; counter - 1
0x06  80           DUP1
0x07  e1 ff f8     RJUMPI -8        ; pc_post = 0x0a, 0x0a - 8 = 0x02
0x0a  00           STOP
```

No `JUMPDEST` is needed at `0x02`; validation checks the target once, before execution.

## Things to know

- Status: **Draft**. Opcode numbers, gas costs and its reliance on EIP-7979 (in Review) may change, and it is not scheduled for any upgrade.
- These instructions first appeared in [EIP-4200](/eip-4200/) as part of the EVM Object Format (EOF). EIP-8013 brings them to the EVM without requiring the EOF container.
- Background on why static control flow matters for the EVM roadmap is collected in [EIP-8173](/eip-8173/).
- A different take on the immediate-argument problem is [EIP-7921](/eip-7921/), which would make every `0x5b` byte a valid jump destination.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-8013
