Package jminusminus

Class CLArithmeticInstruction

java.lang.Object
jminusminus.CLInstruction
jminusminus.CLArithmeticInstruction

class CLArithmeticInstruction extends CLInstruction
Representation for ARITHMETIC1 and ARITHMETIC2 instructions.
  • Constructor Details

    • CLArithmeticInstruction

      public CLArithmeticInstruction(int opcode, int pc)
      Constructs a CLArithmeticInstruction object for ARITHMETIC1 instructions.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
    • CLArithmeticInstruction

      public CLArithmeticInstruction(int opcode, int pc, int localVariableIndex, int constVal, boolean isWidened)
      Constructs a CLArithmeticInstruction object for IINC instruction.
      Parameters:
      opcode - the opcode for this instruction.
      pc - index of this instruction within the code array of a method.
      localVariableIndex - index of the local variable to increment.
      constVal - increment value.
      isWidened - whether this instruction is preceeded by the WIDE (widening) instruction.
  • Method Details

    • toBytes

      public ArrayList<Integer> toBytes()
      Returns the bytecode for this instruction.
      Specified by:
      toBytes in class CLInstruction
      Returns:
      the bytecode for this instruction.