---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 21 Edition"
java_version: 21
chapter: "Chapter 6. The Java Virtual Machine Instruction Set"
section: "6.5.jsr"
heading: "jsr"
parent: "6.5. Instructions"
source: https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-6.html#jvms-6.5.jsr
id: "6.5.jsr"
url: https://jvm.obfuscated.software/jvms/se21/6.5.jsr.html
raw: https://jvm.obfuscated.software/jvms/se21/6.5.jsr.md
---

# jsr

## Operation

Jump subroutine

## Format

```
jsr
branchbyte1
branchbyte2
```

## Forms

*jsr* = 168 (0xa8)

## Operand Stack

... →

..., *address*

## Description

The *address* of the opcode of the instruction immediately following this *jsr* instruction is pushed onto the operand stack as a value of type `returnAddress`. The unsigned *branchbyte1* and *branchbyte2* are used to construct a signed 16-bit offset, where the offset is (*branchbyte1* `<<` 8) | *branchbyte2*. Execution proceeds at that offset from the address of this *jsr* instruction. The target address must be that of an opcode of an instruction within the method that contains this *jsr* instruction.

## Notes

Note that *jsr* pushes the address onto the operand stack and *ret* ([§*ret*](6.5.ret.md)) gets it out of a local variable. This asymmetry is intentional.

In Oracle's implementation of a compiler for the Java programming language prior to Java SE 6, the *jsr* instruction was used with the *ret* instruction in the implementation of the `finally` clause ([§3.13](3.13.md), [§4.10.2.5](4.10.2.5.md)).
