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

# lsub

## Operation

Subtract `long`

## Format

```
lsub
```

## Forms

*lsub* = 101 (0x65)

## Operand Stack

..., *value1*, *value2* →

..., *result*

## Description

Both *value1* and *value2* must be of type `long`. The values are popped from the operand stack. The `long` *result* is *value1* - *value2*. The *result* is pushed onto the operand stack.

For `long` subtraction, `a-b` produces the same result as `a+(-b)`. For `long` values, subtraction from zero is the same as negation.

The result is the 64 low-order bits of the true mathematical result in a sufficiently wide two's-complement format, represented as a value of type `long`. If overflow occurs, then the sign of the result may not be the same as the sign of the mathematical difference of the two values.

Despite the fact that overflow may occur, execution of an *lsub* instruction never throws a run-time exception.
