resolve the string from the String Ref or resolve the Class type from the Class Ref or get the int or float found in the constant pool at the address indicated by the index byte, the string, class type, int or float is pushed onto the operand stack

string class int float value

19

13

load and store instructions

ldc_w

highbyte, lowbyte

resolve the string from the String Ref or resolve the Class type from the Class Ref or get the int or float found in the constant pool at the address indicated by highbyte and lowbyte, the string, class type, int or float is pushed onto the operand stack

string class int float value

20

14

load and store instructions

ldc2_w

highbyte, lowbyte

get long or double found in the constant pool at the address indicated by highbyte and lowbyte, the long or double is pushed onto the operand stack

pop int1 and int2 from operand stack, shift int1 left by s bit positions where s is the value of the low 5 bits of int2 and push the int result onto operand stack

integer value1, integer value2

integer result

121

79

bitwise operations

lshl

pop long and int from operand stack, shift long left by s bit positions where s is the value of the low 6 bits of int and push the long result onto operand stack

long value_1, integer value2

long result

122

7A

bitwise operations

ishr

pop int1 and int2 from operand stack, shift int1 right by s bit positions (while keeping the sign bit the same) where s is the value of the low 5 bits of int2 and push the int result onto operand stack

integer value1, integer value2

integer result

123

7B

bitwise operations

lshr

pop long and int from operand stack, shift long right by s bit positions (while keeing the signbit the same) where s is the value of the low 6 bits of int and push the long result onto operand stack

long value1, integer value2

long result

124

7C

bitwise operations

iushr

pop int1 and int2 from operand stack, shift int1 right by s bit positions (ignore sign bit, add 0 extension) where s is the value of the low 5 bits of int2 and push the int result onto operand stack

integer value1, integer value2

integer result

125

7D

bitwise operations

lushr

pop long and int from operand stack, shift long right by s bit positions (ignore sign bit, add 0 extension) where s is the value of the low 6 bits of int and push the long result onto operand stack

long value1, integer value2

long result

126

7E

bitwise operations

iand

pop two integer values from operand stack and apply AND operation. Push the result onto the operand stack.

integer value1, integer value2

integer result

127

7F

bitwise operations

land

pop two long values from operand stack and apply AND operation. Push the result onto the operand stack.

long value1, long value2

long result

128

80

bitwise operations

ior

pop two integer values from operand stack and apply OR operation. Push the result onto the operand stack.

integer value1, integer value2

integer result

129

81

bitwise operations

lor

pop two long values from operand stack and apply OR operation. Push the result onto the operand stack.

long value1, long value2

long result

130

82

bitwise operations

ixor

pop two integer values from operand stack and apply XOR operation. Push the result onto the operand stack.

integer value1, integer value2

integer result

131

83

bitwise operations

lxor

pop two long values from operand stack and apply XOR operation. Push the result onto the operand stack.

long value1, long value2

long result

132

84

arithmetic operations

iinc

index byte, constbyte

increment the int from the local variable at index indicated by the index byte (unsigned 8-bit integer), with constbyte (signed 8-bit integer)

133

85

widening operations

i2l

pop int from operand stack and sign-extend to a long. Push the result onto the operand stack

integer value

long value

134

86

widening operations

i2f

pop int from operand stack and convert to a float using IEEE 754 and round to nearest mode. Push the result onto the operand stack

integer value

float value

135

87

widening operations

i2d

pop int from operand stack and convert to a double. Push the result onto the operand stack

integer value

double value

136

88

narrowing operations

l2i

pop long from operand stack and convert to an int by taking the low-order 32 bits of the long value and discarding the high-order 32 bits. Push the result onto the operand stack

long value

integer value

137

89

widening operations

l2f

pop long from operand stack and convert to a float using IEEE 754 and round to nearest mode. Push the result onto the operand stack

long value

float value

138

8A

widening operations

l2d

pop long from operand stack and convert to a double using IEEE 754 and round to nearest mode. Push the result onto the operand stack

long value

double value

139

8B

narrowing operations

f2i

pop float from operand stack and convert to an int. Push the result onto the operand stack

float value

integer value

140

8C

narrowing operations

f2l

pop float from operand stack and convert to a long. Push the result onto the operand stack

float value

long value

141

8D

widening operations

f2d

pop float from operand stack and convert to a double. Push the result onto the operand stack

float value

double value

142

8E

narrowing operations

d2i

pop double from operand stack and convert to an int. Push the result onto the operand stack

double value

integer value

143

8F

narrowing operations

d2l

pop double from operand stack and convert to a long. Push the result onto the operand stack

double value

long value

144

90

narrowing operations

d2f

pop double from operand stack and convert to a float. Push the result onto the operand stack

double value

float value

145

91

narrowing operations

i2b

pop int from operand stack and truncate to a byte, then sign-extend to an int. Push the result onto the operand stack

integer value

integer value

146

92

narrowing operations

i2c

pop int from operand stack and truncate to a char, then zero-extend to an int. Push the result onto the operand stack

integer value

integer value

147

93

narrowing operations

i2s

pop int from operand stack and truncate to a short, then sign-extend to an int. Push the result onto the operand stack

If value1 or value2 is NaN, the int value 1 is pushed onto the operand stack.

double value1, double value2

integer value

153

99

control transfer

ifeq

highbyte, lowbyte

pop int value from operand stack, if equal to 0 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value

154

9A

control transfer

ifne

highbyte, lowbyte

pop int value from operand stack, if not equal to 0 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value

155

9B

control transfer

iflt

highbyte, lowbyte

pop int value from operand stack, if less than 0 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value

156

9C

control transfer

ifge

highbyte, lowbyte

pop int value from operand stack, if greater or equal than 0 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value

157

9D

control transfer

ifgt

highbyte, lowbyte

pop int value from operand stack, if greater than 0 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value

158

9E

control transfer

ifle

highbyte, lowbyte

pop int value from operand stack, if less or equal than 0 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value

159

9F

control transfer

if_icmpeq

highbyte, lowbyte

pop two int value from operand stack, if value1 == value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value1, integer value2

160

A0

control transfer

if_icmpne

highbyte, lowbyte

pop two int value from operand stack, if value1 != value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value1, integer value2

161

A1

control transfer

if_icmplt

highbyte, lowbyte

pop two int value from operand stack, if value1 < value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value1, integer value2

162

A2

control transfer

if_icmpge

highbyte, lowbyte

pop two int value from operand stack, if value1 >= value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value1, integer value2

163

A3

control transfer

if_icmpgt

highbyte, lowbyte

pop two int value from operand stack, if value1 > value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value1, integer value2

164

A4

control transfer

if_icmple

highbyte, lowbyte

pop two int value from operand stack, if value1 <= value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

integer value1, integer value2

165

A5

control transfer

if_acmpeq

highbyte, lowbyte

pop two reference values from operand stack, if value1 == value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

reference value1, reference value2

166

A6

control transfer

if_acmpne

highbyte, lowbyte

pop two reference values from operand stack, if value1 != value2 then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

reference value1, reference value2

167

A7

control transfer

goto

highbyte, lowbyte

Jump to the operand stack address indicated by highbyte and lowbyte and execute the opcode at that address

168

A8

control transfer

jsr

highbyte, lowbyte

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. Then jump to operand stack address indicated by highbyte and lowbyte

return address

169

A9

control transfer

ret

index byte

load returnAddress from local variable at index indicated by index byte (unsigned 8-bit integer) and write this value into the Java virtual machine's pc register, and execution continues there.

170

AA

switch statement implementation

tableswitch

access jump table by index and jump

label

2

171

AB

switch statement implementation

lookupswitch

access jump table by key match and jump

label

2

172

AC

method invocation and return

ireturn

pop int from operand stack of the current frame (= method) and push onto the operand stack of the frame of the invoker

integer value

[operand stack empty]

173

AD

method invocation and return

lreturn

pop long from operand stack of the current frame (=method) and push onto the operand stack of the frame of the invoker

long value

[operand stack empty]

174

AE

method invocation and return

freturn

pop float from operand stack of the current frame (=method) and push onto the operand stack of the frame of the invoker

float value

[operand stack empty]

175

AF

method invocation and return

dreturn

pop double from operand stack of the current frame (=method) and push onto the operand stack of the frame of the invoker

double value

[operand stack empty]

176

B0

method invocation and return

areturn

pop object reference from operand stack of the current frame (=method) and push onto the operand stack of the frame of the invoker

object ref

[operand stack empty]

177

B1

method invocation and return

return

exit operand stack of the current frame (=method) and goto the operand stack of the frame of the invoker

[operand stack empty]

178

B2

object creation and manipulation

getstatic

highbyte, lowbyte

resolve the class or interface from the Field Ref found in the constant pool at the address indicated by highbyte and lowbyte, the class or interface value is pushed onto the operand stack

class interface value

179

B3

object creation and manipulation

putstatic

highbyte, lowbyte

the type descriptor referenced by the Field Ref found in the constant pool at the address indicated by highbyte and lowbyte is updated by the value popped from the operand stack

resolve the Class type from the Class Ref found in the constant pool at the address indicated by indexbyte1 and index byte2. Memory for a new instance of that class is allocated from the garbage-collected heap, and the instance variables of the new object are initialized to their default initial values. The objectref, a reference to the instance, is pushed onto the operand stack.

object ref

188

BC

object creation and manipulation

newarray

atype

pop an int value (=count) from the operand stack. This value represents the number of elements in the array to be created. The array type is indicated by the atype value:

BOOLEAN 4
CHAR 5
FLOAT 6
DOUBLE 7
BYTE 8
SHORT 9
INT 10
LONG 11

A new array whose components are of type atype and of length count is allocated from the garbage-collected heap. A reference arrayref to this new array object is pushed into the operand stack.

integer value

array ref

189

BD

object creation and manipulation

anewarray

index byte1, index byte2

pop an int value (=count) from the operand stack. This value represents the number of elements in the array to be created. Indexbyte1 and indexbyte2 are used to construct an index into the constant pool The array type can be a class, array, or interface. A new array with components of that type, of length count, is allocated from the garbage-collected heap, and a reference arrayref to this new array object is pushed onto the operand stack. All components of the new array are initialized to null, the default value for reference types.

integer value

array ref

190

BE

object creation and manipulation

arraylength

The arrayref must be of type reference and must refer to an array. It is popped from the operand stack. The length of the array it references is determined. That length is pushed onto the operand stack as an int.

array ref

integer value

191

BF

athrow

The objectref must be of type reference and must refer to an object that is an instance of class Throwable or of a subclass of Throwable. It is popped from the operand stack. The objectref is then thrown by searching the current method for the first exception handler that matches the class of objectref. If an exception handler that matches objectref is found, it contains the location of the code intended to handle this exception. The pc register is reset to that location, the operand stack of the current frame is cleared, objectref is pushed back onto the operand stack, and execution continues. If no matching exception handler is found in the current frame, that frame is popped. If the current frame represents an invocation of a synchronized method, the monitor acquired or reentered on invocation of the method is released or exited (respectively) as if by execution of a monitorexit instruction. Finally, the frame of its invoker is reinstated, if such a frame exists, and the objectref is rethrown. If no such frame exists, the current thread exits.

object ref

[operand stack empty], object ref

192

C0

object creation and manipulation

checkcast

index byte1, index byte2

check whether object is of given type

object ref

object ref

193

C1

object creation and manipulation

instanceof

determine if object is of given type

class name, or array type

194

C2

monitorenter

enter monitor for object

195

C3

monitorexit

exit monitor for object

196

C4

load and store instructions

wide

Format1: <opcode>, index byte1, index byte2

Format2: <opcode>, index byte1, index byte2, const_byte1, const_byte2

The opcodes iload, fload, aload, lload, dload, istore, fstore, astore, lstore, dstore, ret and iic are all using one index byte to access 256 addresses in the local variable.

The wide instruction extends the local variable index for the above mentioned opcodes by 65536.

Format 1:
The wide opcode is followed by one of the <opcodes> iload, fload, aload, lload, dload, istore, fstore, astore, lstore, dstore, or ret. Following the <opcodes> are two unsigned bytes index byte1 and index byte2 which are assembled into a 16-bit unsigned index to a local variable. These 2 bytes extends the local variable index by 65536.
More information about each <opcodes> can be found elsewhere in this table.

Format 2:
The wide opcode is followed by the opcode iinc, followed by two unsigned bytes index byte1 and index byte2 which are assembled into a 16-bit unsigned index to a local variable. Then two unsigned bytes const_byte1 and const_byte2 are folowed which are also assembled into a signed 16-bit constant.

More information about opcode iinc can be found elsewhere in this table.

Same as modified instruction

Same as modified instruction

197

C5

object creation and manipulation

multianewarray

index byte1, indexbyte2, dimension

create new multi- dimensional array

class name, or array type

2

198

C6

control transfer

ifnull

highbyte, lowbyte

pop reference value from operand stack, if equal to null then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

reference value

199

C7

control transfer

ifnonnull

highbyte, lowbyte

pop reference value from operand stack, if not equal to null then jump to operand stack address indicated by highbyte and lowbyte, else continue with next instruction

The address of the opcode of the instruction immediately following this jsr_w instruction is pushed onto the operand stack as a value of type returnAddress. Then jump to operand stack address indicated by branchbyte1, branchbyte2, branchbyte3, branchbyte4

return address

202

CA

***reserved opcodes***

breakpoint

reserved for breakpoints in Java debuggers; should not appear in any class file

203-253

CB-FD

(no name)

these values are currently unassigned for opcodes and are reserved for future use

254

FE

***reserved opcodes***

impdep1

reserved for implemen- tation dependent operations within debuggers; should not appear in any class file

255

FF

***reserved opcodes***

impdep2

reserved for implemen- tation dependent operations within debuggers; should not appear in any class file