Constant Type | Value |
CONSTANT_Utf8 | 1 |
CONSTANT_Integer | 3 |
CONSTANT_Float | 4 |
CONSTANT_Long | 5 |
CONSTANT_Double | 6 |
CONSTANT_Class | 7 |
CONSTANT_String | 8 |
CONSTANT_Fieldref | 9 |
CONSTANT_Methodref | 10 |
CONSTANT_InterfaceMethodref | 11 |
CONSTANT_NameAndType | 12 |
0 | bits 6-0 |
1 | 1 | 0 | bits 10-6 |
1 | 0 | bits 5-0 |
1 | 1 | 1 | 0 | bits 15-12 |
1 | 0 | bits 11-6 | ||
1 | 0 | bits 5-0 |
name | length | opcode | operand | pop | push | comment |
nop | 1 | 00 | - | - | nop | |
getstatic | 3 | B2 | cp2 | - | X | get static variable |
putstatic | 3 | B3 | cp2 | X | - | put static variable |
getfield | 3 | B4 | cp2 | A | X | get instance variable |
putfield | 3 | B5 | cp2 | AX | - | put instance variable |
iload,
lload
fload, dload, aload |
2 | 15, 16
17~19 |
lv1 | - | X | load local variable
(integer, long, float, double, object) |
istore,
lstore
fstore, dstore, astore |
2 | 36, 37
38~3A |
lv1 | X | - | store local variable |
wide | 0 | C4 | prefix of 2-bytes local variable index instruction | |||
iload_0,
iload_1
iload_2, iload_3 lload_0, lload_1 lload_2, lload_3 fload_0, fload_1 fload_2, fload_3 dload_0, dload_1 dload_2, dload_3 aload_0, aload_1 aload_2, aload_3 |
1 | 1A, 1B
1C, 1D 1E, 1F 20, 21 22, 23 24, 25 26, 27 28, 29 2A, 2B 2C, 2D |
- | X | load local variables #0, #1, #2, #3 | |
istore_0,
istore_1
istore_2, istore_3 lstore_0, lstore_1 lstore_2, lstore_3 fstore_0, fstore_1 fstore_2, fstore_3 dstore_0, dstore_1 dstore_2, dstore_3 astore_0, astore_1 astore_2, astore_3 |
1 | 3B, 3C
3D, 3E 3F, 40 41, 42 43, 44 45, 46 47, 48 49, 4A 4B, 4C 4D, 4E |
X | - | load local variables #0, #1, #2, #3 | |
iaload,
laload
faload, daload aaload |
1 | 2E, 2F
30, 31 32 |
[X]I | X | load from array | |
baload,
caload
saload |
1 | 33, 34
35 |
[X]I | I | load from array
(byte, char, short) |
|
iastore,
lastore
fastore, dastore aastore |
1 | 4F, 50
51, 52 53 |
[X]IX | - | store into array | |
bastore,
castore
sastore |
1 | 54, 55
56 |
[X]II | - | store into array | |
aconst_null
iconst_m1 iconst_0, iconst_1 iconst_2, iconst_3 iconst_4, iconst_5 lconst_0, lconst_1 fconst_0, fconst_1 fconst_2 dconst_0, dconst_1 |
1 | 01
02 03, 04 05, 06 07, 08 09, 0A 0B, 0C 0D 0E, 0F |
- | X | push constant | |
bipush | 2 | 10 | int1 | - | I | push 1-byte value |
sipush | 3 | 11 | int2 | - | I | push 2-bytes value |
ldc | 2 | 12 | cp1 | - | X | load from constant pool (1-word data) |
ldc_w | 3 | 13 | cp2 | - | X | load from constant pool (1-word data) |
ldc2_w | 3 | 14 | cp2 | - | X | load from constant pool (2-word data) |
pop | 1 | 57 | 1 | - | pop top element | |
pop2 | 1 | 58 | 21 | - | pop top two elements | |
dup | 1 | 59 | 1 | 11 | duplicate top element | |
dup_x1 | 1 | 5A | 21 | 121 | duplicate top element; put 2 down | |
dup_x2 | 1 | 5B | 321 | 1321 | duplicate top element; put 3 down | |
dup2 | 1 | 5C | 21 | 2121 | duplicate top two elements | |
dup2_x1 | 1 | 5D | 321 | 21321 | duplicate top two elements; put 3 down | |
dup2_x2 | 1 | 5E | 4321 | 214321 | duplicate top two elements; put 4 down | |
swap | 1 | 5F | 21 | 12 | swap top two elements of stack | |
i2l,
i2f, i2d
l2i, l2f, l2d f2i, f2l, f2d d2i, d2l, d2f |
1 | 85~87
88~8A 8B~8D 8E~90 |
X | X | type conversion | |
i2b, i2c, i2s | 1 | 91~93 | I | I | type conversion | |
iadd,
ladd
fadd, dadd |
1 | 60, 61
62, 63 |
XX | X | addition | |
isub,
lsub
fsub, dsub |
1 | 64, 65
66, 67 |
XX | X | subtraction | |
imul,
lmul
fmul, dmul |
1 | 68, 69
6A, 6B |
XX | X | multiplication | |
idiv,
ldiv
fdiv, ddiv |
1 | 6C, 6D
6E, 6F |
XX | X | division | |
irem,
lrem
frem, drem |
1 | 70, 71
72, 73 |
XX | X | modulo | |
ineg,
lneg
fneg, dneg |
1 | 74, 75
76, 77 |
X | X | negation | |
ishl, lshl | 1 | 78, 79 | XI | X | shift left | |
ishr, lshr | 1 | 7A, 7B | XI | X | shift right | |
iushr, lushr | 1 | 7C, 7D | XI | X | unsigned shift right | |
iand, land | 1 | 7E, 7F | XX | X | boolean and | |
ior, lor | 1 | 80, 81 | XX | X | boolean or | |
ixor, lxor | 1 | 82, 83 | XX | X | boolean xor | |
iinc | 3 | 84 | lv1 int1 | - | - | increment local variable by constant |
goto | 3 | A7 | offset2 | - | - | unconditional goto |
goto_w | 5 | C8 | offset4 | - | - | unconditional goto |
ifeq,
ifne, iflt
ifge, ifgt, ifle |
3 | 99~9B
9C~9E |
offset2 | I | - | conditional goto (w.r.t. 0) |
if_icmpeq,
if_icmpne
if_icmplt, if_icmpge if_icmpgt, if_icmple |
3 | 9F, A0
A1, A2 A3, A4 |
offset2 | II | - | conditional goto
(compare top two elements) |
lcmp | 1 | 94 | LL | I | long compare | |
fcmpl | 1 | 95 | FF | I | float compare. -1 on incomparable | |
fcmpg | 1 | 96 | FF | I | float compare. 1 on incomparable | |
dcmpl | 1 | 97 | DD | I | double compare. -1 on incomparable | |
dcmpg | 1 | 98 | DD | I | double compare. 1 on incomparable | |
ifnull, ifnonnull | 3 | C6, C7 | offset2 | A | - | conditional goto (w.r.t. null) |
if_acmpeq
if_acmpne |
3 | A5
A6 |
offset2 | AA | - | conditional goto
(compare top two elements) |
tableswitch | ? | AA | ? | I | - | goto (switch-case) |
lookupswitch | ? | AB | ? | I | - | goto (switch-case) |
invokevirtual | 3 | B6 | cp2 | AXX | - | call an instance method
(assuming: 2 arguements) |
invokespecial | 3 | B7 | cp2 | AXX | - | call <init>, private method, method of superclass
(assuming: 2 arguements) |
invokestatic | 3 | B8 | cp2 | XX | - | call a static method
(assuming: 2 arguements) |
invokeinterface | 5 | B9 | cp2 +int1 0 | AXX | - | call an interface method
(assuming: 2 arguements) |
ireturn,
lreturn
freturn, dreturn areturn |
1 | AC, AD
AE, AF B0 |
X | - | return value from procedure | |
return | 1 | B1 | - | - | return (void) from procedure | |
new | 3 | BB | cp2 | - | A | create a new object |
checkcast | 3 | C0 | cp2 | A | A | throw error if object not of given type |
instanceof | 3 | C1 | cp2 | A | I | is object of given type? |
newarray | 2 | BC | flag1 | I | A | create a new array of non-objects |
anewarray | 3 | BD | cp2 | I | A | create a new array of objects |
multianewarray | 4 | C5 | cp2 +int1 | II | A | create multidimensional array
(assuming: 2-d) |
arraylength | 1 | BE | [X] | I | get length of array | |
jsr | 3 | A8 | offset2 | - | R | jump subroutine |
jsr_w | 5 | C9 | offset4 | - | R | jump subroutine |
ret | 2 | A9 | lv1 | - | - | return from subroutine |
athrow | 1 | BF | O | - | throw an exception | |
monitorenter | 1 | C2 | A | - | enter a monitored region of code | |
monitorexit | 1 | C3 | A | - | exit a monitored region of code | |
breakpoint | 1 | CA | - | - | call breakpoint handler | |
xxxunusedxxx | 0 | BA | was newfromname |