JVM Instructions

The JVM specification defines nearly 200+ instructions, as shown in the table below:

opSyntaxStackDescription
0x00nopNo changeDo nothing
0x01aconst_null... → ...,nullPush null reference onto the stack[^1] top
0x02iconst_m1... → ...,-1Push int constant -1 onto the stack top
0x03iconst_0.. . → ...,0Push int constant 0 onto the stack top
0x04iconst_1... → ...,1Push int constant 1 onto the stack top
0x05iconst_2... → ...,2Push int constant 2 onto the stack top
0x06iconst_3... → ...,3Push int constant 3 onto the stack top
0x07iconst_4... → ...,4Push int constant 4 onto the stack top
0x08iconst_5... → ...,5Push int constant 5 onto the stack top
0x09lconst_0... → ...,0LPush long constant 0L onto the stack top
0x0alconst_1... → ...,1LPush long constant 1L onto the stack top
0x0bfconst_0... → ...,0.0fPush float constant 0.0f onto the stack top
0x0cfconst_1... → ...,1.0fPush float constant 1.0f onto the stack top
0x0dfconst_2... → ...,2.0fPush float constant 1.0f onto the stack top
0x0edconst_0... → ...,0.0Push double constant 0.0 onto the stack top
0x0fdconst_1... → ...,1.0Push double constant 1.0 onto the stack top
0x10bipush,AA[^2]... → ...,vPush immediate[^3] value AA onto the stack top
0x11sipush,AAAA[^4]... → ...,vPush immediate value AAAA onto the stack top
0x12ldc,AA... → ...,vPush constant at index AA in constant pool onto the stack top
0x13ldc_w,AAAA... → ...,vPush constant at index AAAA in constant pool onto the stack top
0x14ldc2_w,AAAA... → ...,vPush long or double constant at index AAAA in constant pool onto the stack top
0x15iload,AA... → ...,vPush int variable at index AA in local variable table onto the stack top
0x16lload,AA... → ...,vPush long variable at index AA in local variable table onto the stack top
0x17fload,AA... → ...,vPush float variable at index AA in local variable table onto the stack top
0x18dload,AA... → ...,vPush double variable at index AA in local variable table onto the stack top
0x19aload,AA... → ...,vPush aref at index AA in local variable table onto the stack top
0x1aiload_0... → ...,0Push int variable at index 0 in local variable table onto the stack top
0x1biload_1... → ...,1Push int variable at index 1 in local variable table onto the stack top
0x1ciload_2... → ...,2Push int variable at index 2 in local variable table onto the stack top
0x1diload_3... → ...,3Push int variable at index 3 in local variable table onto the stack top
0x1elload_0... → ...,0LPush long variable at index 0 in local variable table onto the stack top
0x1flload_1... → ...,1LPush long variable at index 1 in local variable table onto the stack top
0x20lload_2... → ...,2LPush long variable at index 2 in local variable table onto the stack top
0x21lload_3... → ...,3LPush long variable at index 3 in local variable table onto the stack top
0x22fload_0... → ...,0.0fPush float variable at index 0 in local variable table onto the stack top
0x23fload_1... → ...,1.0fPush float variable at index 1 in local variable table onto the stack top
0x24fload_2... → ...,2.0fPush float variable at index 2 in local variable table onto the stack top
0x25fload_3... → ...,3.0fPush float variable at index 3 in local variable table onto the stack top
0x26dload_0... → ...,0.0Push double variable at index 0 in local variable table onto the stack top
0x27dload_1... → ...,1.0Push double variable at index 1 in local variable table onto the stack top
0x28dload_2... → ...,2.0Push double variable at index 2 in local variable table onto the stack top
0x29dload_3... → ...,3.0Push double variable at index 3 in local variable table onto the stack top
0x2aaload_0... → ...,arefPush aref at index 0 in local variable table onto the stack top
0x2baload_1... → ...,arefPush aref at index 1 in local variable table onto the stack top
0x2caload_2... → ...,arefPush aref at index 2 in local variable table onto the stack top
0x2daload_3... → ...,arefPush aref at index 3 in local variable table onto the stack top
0x2eiaload*...,aaref,index → ...,vPush int value at index (int) in array aaref onto the stack top
0x2flaload...,aaref,index → ...,vPush long value at index (int) in array aaref onto the stack top
0x30faload...,aaref,index → ...,vPush float value at index (int) in array aaref onto the stack top
0x31daload...,aaref,index → ...,vPush double value at index (int) in array aaref onto the stack top
0x32aaload...,aaref,index → ...,vPush reference value at index (int) in array aaref onto the stack top
0x33baload...,aaref,index → ...,vPush byte or boolean value at index (int) in array aaref onto the stack top
0x34caload...,aaref,index → ...,vPush char value at index (int) in array aaref onto the stack top
0x35saload...,aaref,index → ...,vPush short value at index (int) in array aaref onto the stack top
0x36istore,AA...,v → ...,Pop int value from stack top and store to local variable at index AA
0x37lstore,AA...,v → ...,Pop long value from stack top and store to local variable at index AA
0x38fstore,AA...,v → ...,Pop float value from stack top and store to local variable at index AA
0x39dstore,AA...,v → ...,Pop double value from stack top and store to local variable at index AA
0x3aastore,AA...,v → ...,Pop reference value from stack top and store to local variable at index AA
0x3bistore_0...,v → ...,Pop int value from stack top and store to local variable at index 0
0x3cistore_1...,v → ...,Pop int value from stack top and store to local variable at index 1
0x3distore_2...,v → ...,Pop int value from stack top and store to local variable at index 2
0x3eistore_3...,v → ...,Pop int value from stack top and store to local variable at index 3
0x3flstore_0...,v → ...,Pop long value from stack top and store to local variable at index 0
0x40lstore_1...,v → ...,Pop long value from stack top and store to local variable at index 1
0x41lstore_2...,v → ...,Pop long value from stack top and store to local variable at index 2
0x42lstore_3...,v → ...,Pop long value from stack top and store to local variable at index 3
0x43fstore_0...,v → ...,Pop float value from stack top and store to local variable at index 0
0x44fstore_1...,v → ...,Pop float value from stack top and store to local variable at index 1
0x45fstore_2...,v → ...,Pop float value from stack top and store to local variable at index 2
0x46fstore_3...,v → ...,Pop float value from stack top and store to local variable at index 3
0x47dstore_0...,v → ...,Pop double value from stack top and store to local variable at index 0
0x48dstore_1...,v → ...,Pop double value from stack top and store to local variable at index 1
0x49dstore_2...,v → ...,Pop double value from stack top and store to local variable at index 2
0x4adstore_3...,v → ...,Pop double value from stack top and store to local variable at index 3
0x4bastore_0...,aref → ...,Pop reference value from stack top and store to local variable at index 0
0x4castore_1...,aref → ...,Pop reference value from stack top and store to local variable at index 1
0x4dastore_2...,aref → ...,Pop reference value from stack top and store to local variable at index 2
0x4eastore_3...,aref → ...,Pop reference value from stack top and store to local variable at index 3
0x4fiastore...,aaref,index,v → ...,Pop aaref, index (int), v (int) from stack top and store v into aaref[index]
0x50lastore...,aaref,index,v → ...,Pop aaref, index (int), v (long) from stack top and store v into aaref[index]
0x51fastore...,aaref,index,v → ...,Pop aaref, index (int), v (float) from stack top and store v into aaref[index]
0x52dastore...,aaref,index,v → ...,Pop aaref, index (int), v (double) from stack top and store v into aaref[index]
0x53aastore...,aaref,index,v → ...,Pop aaref, index (int), v (reference) from stack top and store v into aaref[index]
0x54bastore...,aaref,index,v → ...,Pop aaref, index (int), v (byte) from stack top and store v into aaref[index]
0x55castore...,aaref,index,v → ...,Pop aaref, index (int), v (char) from stack top and store v into aaref[index]
0x56sastore...,aaref,index,v → ...,Pop aaref, index (int), v (short) from stack top and store v into aaref[index]
0x57pop...,v → ...,Pop the top value from the stack
0x58pop2...,v2,v1 → ...,Pop 1 or 2 values from the stack top
0x59dup...,v → ...,v,vDuplicate the top value and push the duplicate onto the stack top
0x5adup_x1...,v2,v1 → ...,v1,v2,v1Duplicate the top value and insert the duplicate at the 2nd position from the top
0x5bdup_x2...,v3,v2,v1 → ...,v1,v3,v2,v1Duplicate the top value and insert the duplicate at the 2nd or 3rd position from the top
0x5cdup2...,v2,v1 → ...,v2,v1,v2,v1Duplicate the top 1 or 2 values and push the duplicates onto the stack in original order
0x5ddup2_x1...,v3,v2,v1 → ...,v2,v1,v3,v2,v1Duplicate the top 1 or 2 values and insert the duplicates at the 2nd or 3rd position from the top in original order
0x5edup2_x2...,v4,v3,v2,v1 → ...,v2,v1,v4,v3,v2,v1Duplicate the top 1 or 2 values and insert the duplicates at the 2nd, 3rd, or 4th position from the top in original order
0x5fswap...,v2,v1 → ...,v1,v2Swap the top two values on the stack
0x60iadd...,v1,v2 → ...,resultAdd the top two int values and push the result onto the stack top
0x61ladd...,v1,v2 → ...,resultAdd the top two long values and push the result onto the stack top
0x62fadd...,v1,v2 → ...,resultAdd the top two float values and push the result onto the stack top
0x63dadd...,v1,v2 → ...,resultAdd the top two double values and push the result onto the stack top
0x64isub...,v1,v2 → ...,resultSubtract the top int value from the second top int value and push the result onto the stack top
0x65lsub...,v1,v2 → ...,result
0x66fsub...,v1,v2 → ...,result
0x67dsub...,v1,v2 → ...,result
0x68imul...,v1,v2 → ...,result
0x69lmul...,v1,v2 → ...,result
0x6afmul...,v1,v2 → ...,result
0x6bdmul...,v1,v2 → ...,result
0x6cidiv...,v1,v2 → ...,result
0x6dldiv...,v1,v2 → ...,result
0x6efdiv...,v1,v2 → ...,result
0x6fddiv...,v1,v2 → ...,result
0x70irem...,v1,v2 → ...,result
0x71lrem...,v1,v2 → ...,result
0x72frem...,v1,v2 → ...,result
0x73drem...,v1,v2 → ...,result
0x74ineg...,v1,v2 → ...,result
0x75lneg...,v1,v2 → ...,result
0x76fneg...,v1,v2 → ...,result
0x77dneg...,v1,v2 → ...,result
0x78ishl...,v1,v2 → ...,result
0x79lshl...,v1,v2 → ...,result
0x7aishr...,v1,v2 → ...,result
0x7blshr...,v1,v2 → ...,result
0x7ciushr...,v1,v2 → ...,result
0x7dlushr...,v1,v2 → ...,result
0x7eiand...,v1,v2 → ...,result
0x7fland...,v1,v2 → ...,result
0x80ior...,v1,v2 → ...,result
0x81lor...,v1,v2 → ...,result
0x82ixor...,v1,v2 → ...,result
0x83lxor...,v1,v2 → ...,result
0x84iinc,AA,+BB[^5]...,v → ...,result
0x85i2l...,v → ...,result
0x86i2f...,v → ...,result
0x87i2d...,v → ...,result
0x88l2i...,v → ...,result
0x89l2f...,v → ...,result
0x8al2d...,v → ...,result
0x8bf2i...,v → ...,result
0x8cf2l...,v → ...,result
0x8df2d...,v → ...,result
0x8ed2i...,v → ...,result
0x8fd2l...,v → ...,result
0x90d2f...,v → ...,result
0x91i2b...,v → ...,result
0x92i2c...,v → ...,result
0x93i2s...,v → ...,result
0x94lcmp...,v1,v2 → ...,result
0x95fcmpl...,v1,v2 → ...,result
0x96fcmpg...,v1,v2 → ...,result
0x97dcmpl...,v1,v2 → ...,result
0x98dcmpg...,v1,v2 → ...,result
0x99ifeq,+AAAA...,v1,v2 → ...,result
0x9aifne,+AAAA...,v1,v2 → ...,result
0x9biflt,+AAAA...,v1,v2 → ...,result
0x9cifge,+AAAA...,v1,v2 → ...,result
0x9difgt,+AAAA...,v1,v2 → ...,result
0x9eifle,+AAAA...,v1,v2 → ...,result
0x9fif_icmpeq,+AAAA...,v1,v2 → ...,result
0xa7goto,+AAAA
0xa0if_icmpne,+AAAA...,v1,v2 → ...,result
0xa1if_icmplt,+AAAA...,v1,v2 → ...,result
0xa2if_icmpge,+AAAA...,v1,v2 → ...,result
0xa3if_icmpgt,+AAAA...,v1,v2 → ...,result
0xa4if_icmple,+AAAA...,v1,v2 → ...,result
0xa5if_acmpeq,+AAAA...,v1,v2 → ...,result
0xa6if_acmpne,+AAAA...,v1,v2 → ...,result
0xa8jsr,+AAAA... → ...,address
0xa9ret,AANo change
0xaatableswitch
[0]{0,3}
+AAAAAAAA
+BBBBBBBB
+CCCCCCCC
{+DDDDDDDD..+NNNNNNNN}
...,index → ...
0xablookupswitch
[0]{0,3}
+AAAAAAAA
+BBBBBBBB
+CCCCCCCC
{+DDDDDDDD..+NNNNNNNN}
...,key → ...
0xacireturn...,v → [empty]
0xadlreturn...,v → [empty]
0xaefreturn...,v → [empty]
0xafdreturn...,v → [empty]
0xb0areturn...,v → [empty]
0xb1return...,v → [empty]
0xb2getstatic,AAAA... → ...,v
0xb3putstatic,AAAA... → ...,v
0xb4getfield,AAAA...,aref → ...,v
0xb5putfield,AAAA...,aref → ...,v
0xb6invokevirtual,AAAA...,aref,[arg1,[arg2...]] → ...
0xb7invokespecial,AAAA...,aref,[arg1,[arg2...]] → ...
0xb8invokestatic,AAAA...,[arg1,[arg2...]] → ...
0xb9invokeinterface,AAAA,BB,00...,aref,[arg1,[arg2...]] → ...
0xbainvokedynamic,AAAA,00,00...,[arg1,[arg2...]] → ...
0xbbnew,AAAA... → ...,aref
0xbcnewarray,AA...,count → ...,aaref
0xbdanewarray,AAAA...,count → ...,aaref
0xbearraylength...,aaref → ...,length
0xbfathrow...,aref → ...,aref
0xc0checkcast,AAAA...,aref → ...,aref
0xc1instanceof,AAAA...,aref → ...,result
0xc2monitorenter...,aref → ...
0xc3monitorexit...,aref → ...
0xc4wide,<opcode>,AAAA,[BBBB]Same as original instruction
0xc5multianewarray,AAAA,BB...,count1,[count2,...] → ...,aaref
0xc6ifnull,+AAAA...,v → ...
0xc7ifnonnull,+AAAA...,v → ...
0xc8goto_w,+AAAAAAAANo change
0xc9jsr_w,+AAAAAAAA... → ...,address
0xcabreakpointReserved for Java debugger
0xcb...Reserved
......Reserved
0xfd...Reserved
0xfeimpdep1Reserved for debugger
0xffimpdep2Reserved for debugger

[^1]: A stack structure used for storing operands. JVM instructions take operands from the stack during execution and push results back to the stack top. The stack is also used to store method parameters (the first parameter of non-static methods is the this reference) and method return results. [^2]: AA represents 1 unsigned byte (unsigned byte) [^3]: Data that is directly encoded in the instruction and used as an operand. For example: bipush 0x10, where 0x10 is directly encoded into the instruction sequence, which is an immediate value. [^4]: AAAA represents 1 unsigned 16-bit integer (unsigned 16-bit int) [^5]: +BB represents 1 signed byte (signed byte)