Contents Prev Next Up

## The Java Virtual Machine

# Instruction Format

instruction name
The Visual Stack Representation

Java virtual machine instructions are represented in this document by an entry of the form:

### instruction name

A short description of the instruction

    xbc ., value1, value2 xde  ..., value3

A longer description that explains the functions of the instruction and indicates any exceptions that might be thrown during execution.

The items in the syntax diagram are always 8 bits wide.

### The Visual Stack Representation

The effect of an instruction's execution on the operand stack is represented textually, with the stack growing from left to right. Words on the operand stack are all 32 bits wide. Thus, for

    ..., value1, value2 xde  ..., value3

value2 is on top of the stack with value1 just beneath it. Both are 32-bit quantities. As a result of the execution of the instruction, value1 and value2 are popped from the stack and replaced by value3, which has been calculated by the instruction. The remainder of the stack, represented by ellipsis, is unaffected by the instruction's execution.

Long integers and double precision floats are always shown as taking up two words on the operand stack, e.g.,

    ... xde  ..., value-word1, value-word2

Implementors are free to decide the appropriate way to divide two-word long integers and double precision floats into word1 and word2.

Contents Prev Next Up

Generated with CERN WebMaker