Java virtual machine instructions consist of a one-byte number (opcode) representing the meaning of a particular operation, followed by zero or more parameters (operands) representing the operation. Bytecode instruction set is a kind of instruction set architecture with distinct characteristics and outstanding advantages and disadvantages. As the length of Java virtual machine opcodes is limited to one byte, the total number of opcodes in the instruction set cannot exceed 256.

Load and store instructions

  • Load a local variable onto the operation stack

    Iload, ILoAD_ < N >, lload, lload_< N >, fload, fload_< N >, dload, dload_< N >, aload, ALOad_ < N >Copy the code
  • Stores a value from the operand stack to the local variable table

    Fstore, fstore_< N >, dstore, dstore_< N >, astore, astore_< N >, istore, istore_< N >, lstore, lstore_<n>Copy the code
  • Load a constant onto the operand stack

    Bipush, sipush, LDC, LDC_W, LDC2_W, aconST_NULL, ICONST_ML, iconST_ < I >, LCONST_ < L >, fCONST_ < F >, dCONST_ < D >Copy the code
  • An instruction that extends the access index of a local variable table

    wide
    Copy the code

Operation instruction

  • Add instruction

    Iadd, LADD, fADD, DADDCopy the code
  • Subtraction instructions

    Isub, LSUB, FSUB, dsubCopy the code
  • Multiplication instructions

    Imul, LMUL, FMUL, DMULCopy the code
  • Division instructions

    Idiv, LDIV, FDIV, DDIVCopy the code
  • For more instruction

    Irem, LREM, FREM, DREMCopy the code
  • Take the instruction

    Ineg, LNEg, FNEg, dNEgCopy the code
  • Displacement instructions

    Ishl, ISHR, iUSHR, LSHL, Lshe, lushrCopy the code
  • By bit or instruction

    Ior, lorCopy the code
  • By bit and instruction

    Iand, landCopy the code
  • Bitwise xOR instruction

    Ixor, lxorCopy the code
  • Local variable increment instruction

    iinc
    Copy the code
  • More instructions

    DCMPG, DCMPL, FCMPG, FCMPL, LCMPCopy the code